Search in sources :

Example 11 with AbstractGraphRow

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);
}
Also used : AbstractGraphRow(kg.apc.charting.AbstractGraphRow) GraphRowOverallAverages(kg.apc.charting.rows.GraphRowOverallAverages) Test(org.junit.Test)

Example 12 with AbstractGraphRow

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);
}
Also used : AbstractGraphRow(kg.apc.charting.AbstractGraphRow) CollectionProperty(org.apache.jmeter.testelement.property.CollectionProperty) DateTimeRenderer(kg.apc.charting.DateTimeRenderer) PropertyIterator(org.apache.jmeter.testelement.property.PropertyIterator) JMeterVariableEvaluator(kg.apc.jmeter.JMeterVariableEvaluator) GraphRowExactValues(kg.apc.charting.rows.GraphRowExactValues)

Example 13 with AbstractGraphRow

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;
}
Also used : GraphPanelChart(kg.apc.charting.GraphPanelChart) AbstractGraphRow(kg.apc.charting.AbstractGraphRow)

Example 14 with AbstractGraphRow

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);
    }
}
Also used : AbstractGraphRow(kg.apc.charting.AbstractGraphRow)

Example 15 with AbstractGraphRow

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);
}
Also used : AbstractGraphRow(kg.apc.charting.AbstractGraphRow) GraphRowAverages(kg.apc.charting.rows.GraphRowAverages) Test(org.junit.Test)

Aggregations

AbstractGraphRow (kg.apc.charting.AbstractGraphRow)26 Test (org.junit.Test)5 DateTimeRenderer (kg.apc.charting.DateTimeRenderer)3 GraphRowAverages (kg.apc.charting.rows.GraphRowAverages)3 GraphRowExactValues (kg.apc.charting.rows.GraphRowExactValues)3 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)2 GraphRowOverallAverages (kg.apc.charting.rows.GraphRowOverallAverages)2 HashSet (java.util.HashSet)1 GraphPanelChart (kg.apc.charting.GraphPanelChart)1 JMeterVariableEvaluator (kg.apc.jmeter.JMeterVariableEvaluator)1 JSettingsPanel (kg.apc.jmeter.vizualizers.JSettingsPanel)1 CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)1 PropertyIterator (org.apache.jmeter.testelement.property.PropertyIterator)1 Before (org.junit.Before)1