Search in sources :

Example 6 with GraphRowPercentiles

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);
}
Also used : GraphRowPercentiles(kg.apc.charting.rows.GraphRowPercentiles)

Example 7 with GraphRowPercentiles

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);
}
Also used : GraphRowPercentiles(kg.apc.charting.rows.GraphRowPercentiles)

Example 8 with GraphRowPercentiles

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);
}
Also used : GraphRowPercentiles(kg.apc.charting.rows.GraphRowPercentiles)

Example 9 with GraphRowPercentiles

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);
}
Also used : AbstractGraphPanelChartElement(kg.apc.charting.AbstractGraphPanelChartElement) GraphRowPercentiles(kg.apc.charting.rows.GraphRowPercentiles)

Example 10 with GraphRowPercentiles

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);
}
Also used : Entry(java.util.Map.Entry) AbstractGraphPanelChartElement(kg.apc.charting.AbstractGraphPanelChartElement) GraphRowPercentiles(kg.apc.charting.rows.GraphRowPercentiles)

Aggregations

GraphRowPercentiles (kg.apc.charting.rows.GraphRowPercentiles)11 AbstractGraphPanelChartElement (kg.apc.charting.AbstractGraphPanelChartElement)4 Entry (java.util.Map.Entry)3 Iterator (java.util.Iterator)1