use of kg.apc.charting.rows.GraphRowPercentiles in project jmeter-plugins by undera.
the class ResponseTimesPercentilesGui method add.
@Override
public void add(SampleResult res) {
if (!isSampleIncluded(res)) {
return;
}
String label = res.getSampleLabel();
String aggregateLabel = "Overall Response Times";
GraphRowPercentiles row = (GraphRowPercentiles) model.get(label);
GraphRowPercentiles rowAgg = (GraphRowPercentiles) modelAggregate.get(label);
if (row == null) {
row = (GraphRowPercentiles) getNewRow(model, AbstractGraphRow.ROW_PERCENTILES, label, AbstractGraphRow.MARKER_SIZE_NONE, false, false, false, true, false);
}
if (rowAgg == null) {
rowAgg = (GraphRowPercentiles) getNewRow(modelAggregate, AbstractGraphRow.ROW_PERCENTILES, aggregateLabel, AbstractGraphRow.MARKER_SIZE_NONE, false, false, false, true, Color.RED, false);
}
row.add(res.getTime(), 1);
rowAgg.add(res.getTime(), 1);
updateGui(null);
}
use of kg.apc.charting.rows.GraphRowPercentiles in project jmeter-plugins by undera.
the class GraphRowPercentilesTest method testAdd.
/**
* Test of add method, of class GraphRowPercentiles.
*/
@Test
public void testAdd() {
System.out.println("add");
long xVal = 0L;
double yVal = 0.0;
GraphRowPercentiles instance = new GraphRowPercentiles();
instance.add(xVal, yVal);
}
use of kg.apc.charting.rows.GraphRowPercentiles in project jmeter-plugins by undera.
the class GraphRowPercentilesTest method testGetMaxX.
/**
* Test of getMaxX method, of class GraphRowPercentiles.
*/
@Test
public void testGetMaxX() {
System.out.println("getMaxX");
GraphRowPercentiles instance = new GraphRowPercentiles();
long expResult = 1000;
long result = instance.getMaxX();
Assert.assertEquals(expResult, result);
}
use of kg.apc.charting.rows.GraphRowPercentiles in project jmeter-plugins by undera.
the class GraphRowPercentilesTest method testGetElement.
/**
* Test of getElement method, of class GraphRowPercentiles.
*/
@Test
public void testGetElement() {
System.out.println("getElement");
long value = 500L;
GraphRowPercentiles instance = new GraphRowPercentiles();
for (int i = 0; i < expectedCount; i++) {
instance.add(i, i);
}
assertEquals(expectedCount, instance.size());
// force percentile calculation
instance.iterator();
AbstractGraphPanelChartElement result = instance.getElement(value);
assertEquals(32, result.getValue(), 0.001);
}
use of kg.apc.charting.rows.GraphRowPercentiles in project jmeter-plugins by undera.
the class GraphRowPercentilesTest method testIterator_req3.
@Test
public void testIterator_req3() {
System.out.println("iterator 3req");
GraphRowPercentiles instance = new GraphRowPercentiles();
for (int n = 0; n < expectedCount; n++) {
instance.add(n, 1);
}
Iterator<Entry<Long, AbstractGraphPanelChartElement>> result = instance.iterator();
Assert.assertNotNull(result);
Assert.assertTrue(result.hasNext());
int cnt = 0;
while (result.hasNext()) {
Entry<Long, AbstractGraphPanelChartElement> obj = result.next();
Assert.assertNotNull(obj);
// System.err.println(cnt + " " + obj.getValue().getValue());
assertEquals(cnt, obj.getValue().getValue(), 0.01);
cnt++;
}
Assert.assertEquals(expectedCount, cnt);
}
Aggregations