use of kg.apc.charting.AbstractGraphRow in project jmeter-plugins by undera.
the class ChartRowsTableTest method testAddRow2.
/**
* Test of addRow method, of class ChartRowsTable.
*/
@Test
public void testAddRow2() {
System.out.println("addRow");
AbstractGraphRow row = new GraphRowOverallAverages();
ChartRowsTable instance = new ChartRowsTable(null);
instance.addRow(row);
}
use of kg.apc.charting.AbstractGraphRow in project jmeter-plugins by undera.
the class FreeFormArrivalsThreadGroupGui method updateChart.
protected void updateChart(AbstractDynamicThreadGroup tg) {
FreeFormArrivalsThreadGroup atg = (FreeFormArrivalsThreadGroup) tg;
CollectionProperty data = atg.getData();
chartModel.clear();
previewChart.clearErrorMessage();
AbstractGraphRow row = new GraphRowExactValues();
row.setColor(getRowColor());
row.setDrawLine(true);
row.setMarkerSize(AbstractGraphRow.MARKER_SIZE_NONE);
row.setDrawThickLines(true);
// initial value to force min Y
row.add(0, 0);
JMeterVariableEvaluator evaluator = new JMeterVariableEvaluator();
int offset = 0;
double totalArrivals = 0;
PropertyIterator it = data.iterator();
while (it.hasNext()) {
CollectionProperty record = (CollectionProperty) it.next();
double from = evaluator.getDouble(record.get(0));
double to = evaluator.getDouble(record.get(1));
double during = evaluator.getDouble(record.get(2));
row.add(offset * 1000, from);
offset += during * tg.getUnitFactor();
row.add(offset * 1000, to);
totalArrivals += during * from + during * (to - from) / 2;
}
previewChart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, 0));
chartModel.put(getRowLabel(totalArrivals), row);
}
use of kg.apc.charting.AbstractGraphRow in project jmeter-plugins by undera.
the class VariableThroughputTimerGui method createChart.
private Component createChart() {
chart = new GraphPanelChart(false, true);
model = new ConcurrentHashMap<String, AbstractGraphRow>();
chart.setRows(model);
chart.getChartSettings().setDrawFinalZeroingLines(true);
chart.setxAxisLabel("Elapsed Time");
chart.setYAxisLabel("Number of requests /sec");
chart.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
return chart;
}
use of kg.apc.charting.AbstractGraphRow in project jmeter-plugins by undera.
the class JCompositeRowsSelectorPanel method updateTree.
private synchronized void updateTree() {
// get previous selection
TreePath selection = jTreeGraph1.getSelectionPath();
// rows will not disapear, only chart if cleared...
boolean chartsUpdated = false;
// first, check if we need to remove some vizualizers
for (int i = 0; i < root1.getChildCount(); i++) {
TreeNode node = root1.getChildAt(i);
if (!compositeModel.containsVisualizer(node.toString())) {
chartsUpdated = true;
model1.removeNodeFromParent((MutableTreeNode) node);
i--;
}
}
Iterator<String> chartsIter = compositeModel.getVizualizerNamesIterator();
while (chartsIter.hasNext()) {
String chartName = chartsIter.next();
if (!isNodeContained(chartName, root1)) {
chartsUpdated = true;
DefaultMutableTreeNode node1 = new DefaultMutableTreeNode(chartName, true);
root1.add(node1);
Iterator<AbstractGraphRow> rowsIter = compositeModel.getRowsIterator(chartName);
while (rowsIter.hasNext()) {
AbstractGraphRow row = rowsIter.next();
node1.add(new DefaultMutableTreeNode(row.getLabel(), false));
}
} else {
Iterator<AbstractGraphRow> rowsIter = compositeModel.getRowsIterator(chartName);
DefaultMutableTreeNode chartNode1 = getNode(chartName, root1);
while (rowsIter.hasNext()) {
String rowName = rowsIter.next().getLabel();
if (!isNodeContained(rowName, chartNode1)) {
chartsUpdated = true;
chartNode1.add(new DefaultMutableTreeNode(rowName, false));
}
}
}
}
if (chartsUpdated) {
model1.nodeStructureChanged(root1);
expandAll(jTreeGraph1, true);
// restore selection
jTreeGraph1.setSelectionPath(selection);
}
}
use of kg.apc.charting.AbstractGraphRow 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);
}
Aggregations