
kg.apc.charting.elements.GraphPanelChartAverageElement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmeter-plugins-cmn-jmeter Show documentation
Show all versions of jmeter-plugins-cmn-jmeter Show documentation
Various utility classes to ease development of plugins
package kg.apc.charting.elements;
import kg.apc.charting.AbstractGraphPanelChartElement;
/**
* {@inheritDoc}
*/
public class GraphPanelChartAverageElement
extends AbstractGraphPanelChartElement {
private int count = 0;
private double avgValue = 0;
public GraphPanelChartAverageElement(double yVal) {
add(yVal);
}
public GraphPanelChartAverageElement() {
}
public void add(double yVal) {
avgValue = (avgValue * count + yVal) / (++count);
}
/**
* {@inheritDoc}
*/
public double getValue() {
return avgValue;
}
/**
* @return the count
*/
public int getCount() {
return count;
}
@Override
public boolean isPointRepresentative(int limit) {
return count > limit;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy