use of kg.apc.jmeter.JMeterVariableEvaluator 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 kg.apc.jmeter.JMeterVariableEvaluator in project jmeter-plugins by undera.
the class AbstractDynamicThreadGroupGui method updateUI.
public void updateUI() {
super.updateUI();
if (!uiCreated) {
log.debug("Won't update UI");
return;
}
log.debug("Updating UI");
AbstractDynamicThreadGroup atg = createThreadGroupObject();
JMeterVariableEvaluator evaluator = new JMeterVariableEvaluator();
loadFields.UItoModel(atg, evaluator);
additionalFields.UItoModel(atg, evaluator);
try {
updateChart(atg);
} catch (NumberFormatException e) {
previewChart.setErrorMessage("The values entered cannot be rendered in preview...");
} finally {
setChartPropertiesFromTG(atg);
previewChart.invalidateCache();
previewChart.repaint();
}
if (loadFields instanceof LoadParamsFieldsPanel) {
LoadParamsFieldsPanel panel = (LoadParamsFieldsPanel) loadFields;
panel.changeUnitInLabels(atg.getUnit());
}
}
Aggregations