Search in sources :

Example 1 with GraphRowSumValues

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

the class SteppingThreadGroupGui method updateChart.

private void updateChart(SteppingThreadGroup tg) {
    model.clear();
    GraphRowSumValues row = new GraphRowSumValues();
    row.setColor(Color.RED);
    row.setDrawLine(true);
    row.setMarkerSize(AbstractGraphRow.MARKER_SIZE_NONE);
    row.setDrawThickLines(true);
    final HashTree hashTree = new HashTree();
    hashTree.add(new LoopController());
    JMeterThread thread = new JMeterThread(hashTree, null, null);
    long now = System.currentTimeMillis();
    // test start
    // -1 because row.add(thread.getStartTime() - 1, 0)
    chart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, now - 1));
    row.add(now, 0);
    row.add(now + tg.getThreadGroupDelayAsInt(), 0);
    int numThreads = tg.getNumThreads();
    // users in
    for (int n = 0; n < numThreads; n++) {
        thread.setThreadNum(n);
        tg.scheduleThread(thread, now);
        row.add(thread.getStartTime() - 1, 0);
        row.add(thread.getStartTime(), 1);
    }
    // users out
    for (int n = 0; n < numThreads; n++) {
        thread.setThreadNum(n);
        tg.scheduleThread(thread, now);
        row.add(thread.getEndTime() - 1, 0);
        row.add(thread.getEndTime(), -1);
    }
    model.put("Expected Active Users Count", row);
    chart.invalidateCache();
    chart.repaint();
}
Also used : HashTree(org.apache.jorphan.collections.HashTree) DateTimeRenderer(kg.apc.charting.DateTimeRenderer) GraphRowSumValues(kg.apc.charting.rows.GraphRowSumValues) JMeterThread(org.apache.jmeter.threads.JMeterThread) LoopController(org.apache.jmeter.control.LoopController)

Example 2 with GraphRowSumValues

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

the class UltimateThreadGroupGui method updateChart.

private void updateChart(UltimateThreadGroup tg) {
    tg.testStarted();
    model.clear();
    GraphRowSumValues row = new GraphRowSumValues();
    row.setColor(Color.RED);
    row.setDrawLine(true);
    row.setMarkerSize(AbstractGraphRow.MARKER_SIZE_NONE);
    row.setDrawThickLines(true);
    final HashTree hashTree = new HashTree();
    hashTree.add(new LoopController());
    JMeterThread thread = new JMeterThread(hashTree, null, null);
    long now = System.currentTimeMillis();
    // -1 because row.add(thread.getStartTime() - 1, 0)
    chart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, now - 1));
    chart.setForcedMinX(now);
    row.add(now, 0);
    // users in
    int numThreads = tg.getNumThreads();
    log.debug("Num Threads: " + numThreads);
    for (int n = 0; n < numThreads; n++) {
        thread.setThreadNum(n);
        thread.setThreadName(Integer.toString(n));
        tg.scheduleThread(thread, now);
        row.add(thread.getStartTime() - 1, 0);
        row.add(thread.getStartTime(), 1);
    }
    tg.testStarted();
    // users out
    for (int n = 0; n < tg.getNumThreads(); n++) {
        thread.setThreadNum(n);
        thread.setThreadName(Integer.toString(n));
        tg.scheduleThread(thread, now);
        row.add(thread.getEndTime() - 1, 0);
        row.add(thread.getEndTime(), -1);
    }
    model.put("Expected parallel users count", row);
    chart.invalidateCache();
    chart.repaint();
}
Also used : HashTree(org.apache.jorphan.collections.HashTree) DateTimeRenderer(kg.apc.charting.DateTimeRenderer) GraphRowSumValues(kg.apc.charting.rows.GraphRowSumValues) JMeterThread(org.apache.jmeter.threads.JMeterThread) LoopController(org.apache.jmeter.control.LoopController)

Aggregations

DateTimeRenderer (kg.apc.charting.DateTimeRenderer)2 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