Search in sources :

Example 1 with GraphPanelChartSumElement

use of kg.apc.charting.elements.GraphPanelChartSumElement in project jmeter-plugins by undera.

the class GraphRowSumValues method add.

@Override
public void add(long xVal, double yVal) {
    GraphPanelChartSumElement el;
    if (values.containsKey(xVal)) {
        el = values.get(xVal);
        el.add(yVal);
        yVal = el.getValue();
    } else {
        el = new GraphPanelChartSumElement(yVal);
        values.put(xVal, el);
        countX++;
    }
    super.add(xVal, yVal);
}
Also used : GraphPanelChartSumElement(kg.apc.charting.elements.GraphPanelChartSumElement)

Example 2 with GraphPanelChartSumElement

use of kg.apc.charting.elements.GraphPanelChartSumElement in project jmeter-plugins by undera.

the class GraphRowSumValuesTest method testGetElement.

/**
 * Test of getElement method, of class GraphRowSumValues.
 */
@Test
public void testGetElement() {
    System.out.println("getElement");
    long value = 100L;
    GraphRowSumValues instance = new GraphRowSumValues();
    AbstractGraphPanelChartElement expResult = new GraphPanelChartSumElement(10);
    instance.add(value, 10);
    instance.getElement(value);
    Assert.assertTrue(instance.getElement(value).getValue() == expResult.getValue());
}
Also used : GraphPanelChartSumElement(kg.apc.charting.elements.GraphPanelChartSumElement) AbstractGraphPanelChartElement(kg.apc.charting.AbstractGraphPanelChartElement)

Example 3 with GraphPanelChartSumElement

use of kg.apc.charting.elements.GraphPanelChartSumElement in project jmeter-plugins by undera.

the class GraphRowSumValues method next.

public Entry<Long, AbstractGraphPanelChartElement> next() {
    Entry<Long, GraphPanelChartSumElement> entry = iterator.next();
    GraphPanelChartSumElement ret = entry.getValue();
    // log.info("Rolling: " + entry.getKey() + " " + rollingSum);
    ExactEntry retValue = null;
    if (isRollingSum) {
        rollingSum += ret.getValue();
        retValue = new ExactEntry(entry.getKey(), new GraphPanelChartSumElement(rollingSum));
    } else {
        retValue = new ExactEntry(entry.getKey(), new GraphPanelChartSumElement(ret.getValue()));
    }
    return retValue;
}
Also used : GraphPanelChartSumElement(kg.apc.charting.elements.GraphPanelChartSumElement)

Aggregations

GraphPanelChartSumElement (kg.apc.charting.elements.GraphPanelChartSumElement)3 AbstractGraphPanelChartElement (kg.apc.charting.AbstractGraphPanelChartElement)1