Package org.rrd4j.data
Class Variable
java.lang.Object
org.rrd4j.data.Variable
- Direct Known Subclasses:
Variable.AVERAGE,Variable.FIRST,Variable.LAST,Variable.LSLCORREL,Variable.LSLINT,Variable.LSLSLOPE,Variable.MAX,Variable.MIN,Variable.PERCENTILE,Variable.STDDEV,Variable.TOTAL
public abstract class Variable extends Object
An abstract class to help extract single value from a set of value (VDEF in rrdtool)
It can be used to add new fancy statistical calculation with rrd values
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVariable.AVERAGECalculate the average of the data points.(package private) static classVariable.ComparPercentElemenThe sort used by rrdtool for percent, where NaN < -INF < finite values < INFstatic classVariable.FIRSTFind the first valid data point and it's timestampstatic classVariable.LASTFind the first last valid point and it's timestampstatic classVariable.LSLCORRELCalculate the correlation coefficient of the least squares line.static classVariable.LSLINTCalculate the y-intercept of the least squares line.static classVariable.LSLSLOPECalculate the slop of the least squares line.static classVariable.MAXThe biggest of the data points and it's time stamp (the first one) is stored.static classVariable.MINThe smallest of the data points and it's time stamp (the first one) is stored.(package private) static classVariable.PercentElemStore all the informations about a datasource point, for predictive and consistent sortingstatic classVariable.PERCENTILEFind the point at the n-th percentile.static classVariable.PERCENTILENANstatic classVariable.STDDEVCalculate the standard deviation for the data point.static classVariable.TOTALCalculate the sum of the data points.static classVariable.ValueThis class store both the value and the time stamp It will be used by graph rendering legend -
Field Summary
Fields Modifier and Type Field Description static Variable.ValueINVALIDVALUE -
Constructor Summary
Constructors Constructor Description Variable() -
Method Summary
Modifier and Type Method Description (package private) voidcalculate(Source s, long start, long end)Used to calculate the needed value from a source, this method call the abstract methodfill(long[], double[], long, long).protected abstract Variable.Valuefill(long[] timestamps, double[] values, long start, long end)This method is call with the needed values, extracted from the datasource to do the calculation.Variable.ValuegetValue()
-
Field Details
-
Constructor Details
-
Variable
public Variable()
-
-
Method Details
-
calculate
Used to calculate the needed value from a source, this method call the abstract methodfill(long[], double[], long, long).- Parameters:
s-start-end-
-
getValue
-
fill
This method is call with the needed values, extracted from the datasource to do the calculation. Value is to be filled with both the double value and a possible timestamp, when it's used to find a specific point- Parameters:
timestamps- the timestamps for the valuevalues- the actual valuesstart- the start of the periodend- the end of the period- Returns:
- a filled Value object
-