Search in sources :

Example 6 with DateTimeRenderer

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

the class VariableThroughputTimerGui method updateChart.

private void updateChart(VariableThroughputTimer tg) {
    model.clear();
    chart.clearErrorMessage();
    AbstractGraphRow row = new GraphRowExactValues();
    row.setColor(Color.BLUE);
    row.setDrawLine(true);
    row.setMarkerSize(AbstractGraphRow.MARKER_SIZE_NONE);
    row.setDrawThickLines(true);
    long now = System.currentTimeMillis();
    int rowsCount = tableModel.getRowCount();
    row.add(now, 0);
    row.add(now, tg.getRPSForSecond(0).getLeft());
    int duration = 0;
    for (int i = 0; i < rowsCount; i++) {
        row.add(now + (duration + 1) * 1000, tg.getRPSForSecond(duration + 1).getLeft());
        int rowVal = getIntFromRow(i, 2);
        if (rowVal < 0) {
            chart.setErrorMessage("The values entered cannot be rendered in preview...");
            break;
        }
        duration = duration + rowVal;
        row.add(now + duration * 1000, tg.getRPSForSecond(duration).getLeft());
    }
    // -1 because row.add(thread.getStartTime() - 1, 0)
    chart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, now - 1));
    chart.setForcedMinX(now);
    model.put("Expected RPS", row);
    chart.invalidateCache();
    chart.repaint();
}
Also used : AbstractGraphRow(kg.apc.charting.AbstractGraphRow) DateTimeRenderer(kg.apc.charting.DateTimeRenderer) GraphRowExactValues(kg.apc.charting.rows.GraphRowExactValues)

Aggregations

DateTimeRenderer (kg.apc.charting.DateTimeRenderer)6 AbstractGraphRow (kg.apc.charting.AbstractGraphRow)3 GraphRowExactValues (kg.apc.charting.rows.GraphRowExactValues)3 GraphRowSumValues (kg.apc.charting.rows.GraphRowSumValues)2 LoopController (org.apache.jmeter.control.LoopController)2 JMeterThread (org.apache.jmeter.threads.JMeterThread)2 HashTree (org.apache.jorphan.collections.HashTree)2 JMeterVariableEvaluator (kg.apc.jmeter.JMeterVariableEvaluator)1 CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)1 PropertyIterator (org.apache.jmeter.testelement.property.PropertyIterator)1