use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class DistributedTestControl method getData.
public CollectionProperty getData() {
CollectionProperty data = (CollectionProperty) getProperty(DATA_PROP);
LinkedList<String> arr = new LinkedList<String>();
for (int n = 0; n < data.size(); n++) {
arr.add(data.get(n).getStringValue());
}
String val = StringUtils.join(arr, ",");
log.debug("Setting hosts 1: " + val);
JMeterUtils.setProperty(PROP_HOSTS, val);
return data;
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class FreeFormArrivalsThreadGroupGui method updateChart.
protected void updateChart(AbstractDynamicThreadGroup tg) {
FreeFormArrivalsThreadGroup atg = (FreeFormArrivalsThreadGroup) tg;
CollectionProperty data = atg.getData();
chartModel.clear();
previewChart.clearErrorMessage();
AbstractGraphRow row = new GraphRowExactValues();
row.setColor(getRowColor());
row.setDrawLine(true);
row.setMarkerSize(AbstractGraphRow.MARKER_SIZE_NONE);
row.setDrawThickLines(true);
// initial value to force min Y
row.add(0, 0);
JMeterVariableEvaluator evaluator = new JMeterVariableEvaluator();
int offset = 0;
double totalArrivals = 0;
PropertyIterator it = data.iterator();
while (it.hasNext()) {
CollectionProperty record = (CollectionProperty) it.next();
double from = evaluator.getDouble(record.get(0));
double to = evaluator.getDouble(record.get(1));
double during = evaluator.getDouble(record.get(2));
row.add(offset * 1000, from);
offset += during * tg.getUnitFactor();
row.add(offset * 1000, to);
totalArrivals += during * from + during * (to - from) / 2;
}
previewChart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, 0));
chartModel.put(getRowLabel(totalArrivals), row);
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class ServersListPanel method loadFromTestElement.
public void loadFromTestElement(DistributedTestControl te) {
CollectionProperty servers = te.getData();
log.debug("Loading: " + servers.toString());
clear();
for (int n = 0; n < servers.size(); n++) {
log.debug("Adding: " + servers.get(n).toString());
add(servers.get(n).getStringValue());
}
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class MergeResultsGui method modifyTestElement.
/**
* Modifies a given TestElement to mirror the data in the gui components.
*
* @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
*/
@Override
public void modifyTestElement(TestElement c) {
super.modifyTestElement(c);
if (c instanceof ResultCollector) {
ResultCollector rc = (ResultCollector) c;
rc.setFilename(getFile());
rc.setProperty(new StringProperty(CorrectedResultCollector.FILENAME, getFile()));
CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, DATA_PROPERTY);
rc.setProperty(rows);
collector = rc;
}
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class MergeResultsGui method configure.
@Override
public void configure(TestElement el) {
super.configure(el);
setFile(el.getPropertyAsString(CorrectedResultCollector.FILENAME));
JMeterProperty fileValues = el.getProperty(DATA_PROPERTY);
if (!(fileValues instanceof NullProperty)) {
CollectionProperty columns = (CollectionProperty) fileValues;
tableModel.removeTableModelListener(this);
JMeterPluginsUtils.collectionPropertyToTableModelRows(columns, tableModel, columnClasses);
tableModel.addTableModelListener(this);
updateUI();
} else {
log.warn("Received null property instead of collection");
}
checkDeleteButtonStatus();
checkMergeButtonStatus();
startTimeRef = 0;
}
Aggregations