Search in sources :

Example 6 with GraphRowOverallAverages

use of kg.apc.charting.rows.GraphRowOverallAverages in project jmeter-plugins by undera.

the class TimesVsThreadsGui method add.

@Override
public void add(SampleResult res) {
    if (!isSampleIncluded(res)) {
        return;
    }
    super.add(res);
    String label = res.getSampleLabel();
    String averageLabel = "Average " + res.getSampleLabel();
    String aggLabel = "Overall Response Times";
    String avgAggLabel = "Average " + aggLabel;
    GraphRowAverages row = (GraphRowAverages) model.get(label);
    GraphRowOverallAverages avgRow = (GraphRowOverallAverages) model.get(averageLabel);
    GraphRowAverages rowAgg = (GraphRowAverages) modelAggregate.get(aggLabel);
    GraphRowOverallAverages avgRowAgg = (GraphRowOverallAverages) modelAggregate.get(avgAggLabel);
    if (row == null || avgRow == null) {
        row = (GraphRowAverages) getNewRow(model, AbstractGraphRow.ROW_AVERAGES, label, AbstractGraphRow.MARKER_SIZE_SMALL, false, false, false, true, false);
        avgRow = (GraphRowOverallAverages) getNewRow(model, AbstractGraphRow.ROW_OVERALL_AVERAGES, averageLabel, AbstractGraphRow.MARKER_SIZE_BIG, false, true, false, false, row.getColor(), false);
    }
    if (rowAgg == null || avgRowAgg == null) {
        rowAgg = (GraphRowAverages) getNewRow(modelAggregate, AbstractGraphRow.ROW_AVERAGES, aggLabel, AbstractGraphRow.MARKER_SIZE_SMALL, false, false, false, true, Color.RED, false);
        avgRowAgg = (GraphRowOverallAverages) getNewRow(modelAggregate, AbstractGraphRow.ROW_OVERALL_AVERAGES, avgAggLabel, AbstractGraphRow.MARKER_SIZE_BIG, false, true, false, false, Color.RED, false);
    }
    int threadsCount = getCurrentThreadCount(res);
    row.add(threadsCount, res.getTime());
    avgRow.add(threadsCount, res.getTime());
    rowAgg.add(threadsCount, res.getTime());
    avgRowAgg.add(threadsCount, res.getTime());
    graphPanel.getGraphObject().setCurrentX(res.getAllThreads());
    updateGui(null);
}
Also used : GraphRowAverages(kg.apc.charting.rows.GraphRowAverages) GraphRowOverallAverages(kg.apc.charting.rows.GraphRowOverallAverages)

Example 7 with GraphRowOverallAverages

use of kg.apc.charting.rows.GraphRowOverallAverages in project jmeter-plugins by undera.

the class GraphRowOverallAveragesTest method testSize.

@Test
public void testSize() {
    System.out.println("size");
    GraphRowOverallAverages instance = new GraphRowOverallAverages();
    int expResult = 1;
    int result = instance.size();
    Assert.assertEquals(expResult, result);
}
Also used : GraphRowOverallAverages(kg.apc.charting.rows.GraphRowOverallAverages)

Example 8 with GraphRowOverallAverages

use of kg.apc.charting.rows.GraphRowOverallAverages in project jmeter-plugins by undera.

the class GraphRowOverallAveragesTest method testAdd.

/**
 * Test of add method, of class GraphRowOverallAverages.
 */
@Test
public void testAdd() {
    System.out.println("add");
    GraphRowOverallAverages instance = new GraphRowOverallAverages();
    instance.add(0, 0);
    assertEquals(0, instance.getKey(), 0.01);
    assertEquals(0, instance.getValue().getValue(), 0.01);
    instance.add(1, 1);
    assertEquals(1, instance.getKey(), 0.01);
    assertEquals(0.5, instance.getValue().getValue(), 0.01);
    instance.add(1, 1);
    assertEquals(1, instance.getKey(), 0.01);
    assertEquals(0.66, instance.getValue().getValue(), 0.01);
    instance.add(5, 10);
    assertEquals(2, instance.getKey(), 0.01);
    assertEquals(3, instance.getValue().getValue(), 0.01);
}
Also used : GraphRowOverallAverages(kg.apc.charting.rows.GraphRowOverallAverages)

Example 9 with GraphRowOverallAverages

use of kg.apc.charting.rows.GraphRowOverallAverages in project jmeter-plugins by undera.

the class GraphRowOverallAveragesTest method testHasNext.

/**
 * Test of hasNext method, of class GraphRowOverallAverages.
 */
@Test
public void testHasNext() {
    System.out.println("hasNext");
    GraphRowOverallAverages instance = new GraphRowOverallAverages();
    Assert.assertTrue(instance.hasNext());
    assertEquals(instance, instance.next());
    Assert.assertFalse(instance.hasNext());
}
Also used : GraphRowOverallAverages(kg.apc.charting.rows.GraphRowOverallAverages)

Example 10 with GraphRowOverallAverages

use of kg.apc.charting.rows.GraphRowOverallAverages in project jmeter-plugins by undera.

the class GraphRowOverallAveragesTest method testRemove.

/**
 * Test of remove method, of class GraphRowOverallAverages.
 */
@Test
public void testRemove() {
    System.out.println("remove");
    GraphRowOverallAverages instance = new GraphRowOverallAverages();
    try {
        instance.remove();
        Assert.fail("Exception expected");
    } catch (UnsupportedOperationException e) {
    }
}
Also used : GraphRowOverallAverages(kg.apc.charting.rows.GraphRowOverallAverages)

Aggregations

GraphRowOverallAverages (kg.apc.charting.rows.GraphRowOverallAverages)14 GraphPanelChartAverageElement (kg.apc.charting.elements.GraphPanelChartAverageElement)3 AbstractGraphPanelChartElement (kg.apc.charting.AbstractGraphPanelChartElement)2 AbstractGraphRow (kg.apc.charting.AbstractGraphRow)2 GraphRowAverages (kg.apc.charting.rows.GraphRowAverages)2 Test (org.junit.Test)2 Iterator (java.util.Iterator)1