use of kg.apc.charting.rows.GraphRowAverages in project jmeter-plugins by undera.
the class CompositeModelTest method testGetRow.
/**
* Test of getRow method, of class CompositeModel.
*/
@Test
public void testGetRow() {
System.out.println("getRow");
String testName = "";
String rowName = "";
CompositeModel instance = new CompositeModel();
instance.setNotifier(notifier);
AbstractGraphRow result = instance.getRow(testName, rowName);
assertNull(result);
instance.addRow(rowName, new GraphRowAverages());
result = instance.getRow(testName, rowName);
assertNotNull(result);
}
use of kg.apc.charting.rows.GraphRowAverages in project jmeter-plugins by undera.
the class ThroughputVsThreadsGui method add.
@Override
public void add(SampleResult res) {
if (!isSampleIncluded(res)) {
return;
}
long time = res.getTime();
if (time < 1) {
return;
}
super.add(res);
String label = res.getSampleLabel();
String averageLabel = "Average " + res.getSampleLabel();
GraphRowAverages row = (GraphRowAverages) model.get(label);
GraphRowOverallAverages avgRow = (GraphRowOverallAverages) model.get(averageLabel);
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);
}
int allThreads = getCurrentThreadCount(res);
double throughput = (double) allThreads * 1000.0d / time;
row.add(allThreads, throughput);
avgRow.add(allThreads, throughput);
graphPanel.getGraphObject().setCurrentX(allThreads);
updateGui(null);
}
use of kg.apc.charting.rows.GraphRowAverages in project jmeter-plugins by undera.
the class GraphPanelChartTest method testPaintComponent.
/**
* Test of paintComponent method, of class GraphPanelChart.
*/
@Test
public void testPaintComponent() {
System.out.println("paintComponent");
Graphics g = new TestGraphics();
GraphPanelChart instance = new GraphPanelChart();
instance.setSize(500, 500);
instance.getChartSettings().setDrawFinalZeroingLines(true);
instance.getChartSettings().setDrawCurrentX(true);
instance.getChartSettings().setExpendRows(true);
final ConcurrentSkipListMap<String, AbstractGraphRow> rows = new ConcurrentSkipListMap<String, AbstractGraphRow>();
instance.setRows(rows);
final GraphRowAverages row1 = new GraphRowAverages();
row1.setDrawThickLines(true);
row1.setDrawLine(true);
row1.setDrawBar(true);
row1.setDrawValueLabel(true);
row1.setMarkerSize(AbstractGraphRow.MARKER_SIZE_BIG);
rows.put("test 1", row1);
row1.add(System.currentTimeMillis(), 20);
instance.paintComponent(g);
row1.add(System.currentTimeMillis(), 540);
instance.setxAxisLabelRenderer(new DateTimeRenderer("HH:mm:ss"));
instance.paintComponent(g);
row1.add(System.currentTimeMillis(), 8530);
instance.paintComponent(g);
}
use of kg.apc.charting.rows.GraphRowAverages in project jmeter-plugins by undera.
the class GraphModelToCsvExporterTest method createTestModel.
private ConcurrentSkipListMap<String, AbstractGraphRow> createTestModel() {
ConcurrentSkipListMap<String, AbstractGraphRow> testModel = new ConcurrentSkipListMap<>();
Calendar now = Calendar.getInstance();
now.set(Calendar.HOUR_OF_DAY, 10);
now.set(Calendar.MINUTE, 30);
now.set(Calendar.SECOND, 0);
now.set(Calendar.MILLISECOND, 500);
GraphRowAverages row1 = new GraphRowAverages();
GraphRowAverages row2 = new GraphRowAverages();
GraphRowAverages row3 = new GraphRowAverages();
testModel.put("row1", row1);
testModel.put("row2", row2);
testModel.put("row3", row3);
row1.add(now.getTimeInMillis(), 10);
row2.add(now.getTimeInMillis(), 20);
now.set(Calendar.SECOND, 10);
row1.add(now.getTimeInMillis(), 20);
row2.add(now.getTimeInMillis(), 30);
now.set(Calendar.SECOND, 25);
row3.add(now.getTimeInMillis(), 50);
return testModel;
}
use of kg.apc.charting.rows.GraphRowAverages in project jmeter-plugins by undera.
the class AbstractRowPlotterTest method setUp.
@Before
public void setUp() {
testRow = new GraphRowAverages();
long now = System.currentTimeMillis();
testRow.add(now, 1);
testRow.add(now + 5000, 20);
testRow.add(now + 10000, 50);
testRow.setMarkerSize(3);
minXVal = now;
maxXVal = now + 10000;
minYVal = 1;
maxYVal = 50;
}
Aggregations