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();
}
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();
}
Aggregations