Search in sources :

Example 11 with GraphRowAverages

use of kg.apc.charting.rows.GraphRowAverages 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)

Aggregations

GraphRowAverages (kg.apc.charting.rows.GraphRowAverages)11 AbstractGraphRow (kg.apc.charting.AbstractGraphRow)3 Test (org.junit.Test)3 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)2 GraphRowOverallAverages (kg.apc.charting.rows.GraphRowOverallAverages)2 Calendar (java.util.Calendar)1 TestGraphics (kg.apc.emulators.TestGraphics)1