use of kg.apc.charting.rows.GraphRowExactValues 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.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class GraphRowExactValuesTest method testSize.
@Test
public void testSize() {
System.out.println("size");
GraphRowExactValues instance = new GraphRowExactValues();
int expResult = 0;
int result = instance.size();
Assert.assertEquals(expResult, result);
}
use of kg.apc.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class GraphRowExactValuesTest method testGetElement.
/**
* Test of getElement method, of class GraphRowExactValues.
*/
@Test
public void testGetElement() {
System.out.println("getElement");
long value = 100L;
GraphRowExactValues instance = new GraphRowExactValues();
AbstractGraphPanelChartElement expResult = new GraphPanelChartExactElement(value, 2);
instance.add(value, 2);
AbstractGraphPanelChartElement result = instance.getElement(value);
Assert.assertTrue(instance.getElement(value).getValue() == expResult.getValue());
}
use of kg.apc.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class GraphRowExactValuesTest method testHasNext.
/**
* Test of hasNext method, of class GraphRowExactValues.
*/
@Test
public void testHasNext() {
System.out.println("hasNext");
GraphRowExactValues instance = new GraphRowExactValues();
boolean expResult = false;
boolean result = instance.hasNext();
Assert.assertEquals(expResult, result);
}
use of kg.apc.charting.rows.GraphRowExactValues in project jmeter-plugins by undera.
the class GraphRowExactValuesTest method testIterator.
/**
* Test of iterator method, of class GraphRowExactValues.
*/
@Test
public void testIterator() {
System.out.println("iterator");
GraphRowExactValues instance = new GraphRowExactValues();
instance.add(1, 1);
instance.add(1, 2);
instance.add(1, 3);
Iterator<Entry<Long, AbstractGraphPanelChartElement>> result = instance.iterator();
assertEquals(1, ((AbstractGraphPanelChartElement) result.next().getValue()).getValue(), 0.001);
assertEquals(2, ((AbstractGraphPanelChartElement) result.next().getValue()).getValue(), 0.001);
assertEquals(3, ((AbstractGraphPanelChartElement) result.next().getValue()).getValue(), 0.001);
}
Aggregations