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
Abstract class for extracting single values from data sets (VDEF in rrdtool).
Provides statistical calculations on RRD values and supports custom computation methods for advanced data processing.
Provides statistical calculations on RRD values and supports custom computation methods for advanced data processing.
Can be used to add new statistical calculations with RRD values.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCalculate the average of the data points.(package private) static final classThe sort used by rrdtool for percent, where NaN < -INF < finite values < INFstatic classFind the first valid data point and it's timestampstatic classFind the first last valid point and it's timestampstatic classCalculate the correlation coefficient of the least squares line.static classCalculate the y-intercept of the least squares line.static classCalculate the slop of the least squares line.static classThe biggest of the data points, stamped with the latest point attaining it.static classThe smallest of the data points, stamped with the latest point attaining it.(package private) static final classStore all the informations about a datasource point, for predictive and consistent sortingstatic classFind the point at the n-th percentile.static classPercentile calculation that leaves gap entries out of the ranking.static classCalculate the standard deviation for the data point.static classCalculate the sum of the data points.static final classThis class store both the value and the time stamp It will be used by graph rendering legendField Summary
Modifier and TypeFieldDescriptionstatic final Variable.ValueRepresents an invalid value with NaN (Not a Number) value.private Variable.ValueThe computed value, null until the value has been filled in.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescription(package private) voidUsed 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.getValue()Returns the value left by the lastcalculate(Source, long, long)call.
Field Details
INVALIDVALUE
Represents an invalid value with NaN (Not a Number) value.val
The computed value, null until the value has been filled in.
Constructor Details
Variable
protected Variable()Base constructor for Variable subclasses
Method Details
calculate
Used to calculate the needed value from a source, this method call the abstract methodfill(long[], double[], long, long).Only the points whose step interval overlaps the window are passed on; a
VDefsource is instead kept or discarded as a whole, based on where its value is stamped.- Parameters:
s- source supplying the timestamped values to compute overstart- lower bound of the window, in seconds since epochend- upper bound of the window, in seconds since epoch
getValue
Returns the value left by the lastcalculate(Source, long, long)call.- Returns:
- the computed value,
INVALIDVALUEif the source held no point in the window
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