java.lang.Object
org.rrd4j.data.Source
org.rrd4j.data.CDef
- All Implemented Interfaces:
NonRrdSource
RRD CDEF (Computed Data Source Definition) implementation.
Creates computed data sources using Reverse Polish Notation (RPN) expressions on existing data sources.
Creates computed data sources using Reverse Polish Notation (RPN) expressions on existing data sources.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe RPN expression that computes this source's values.Fields inherited from class Source
timestamps, valuesModifier and TypeFieldDescriptionprotected long[]timestamps corresponding to data valuesprotected double[]data valuesConstructor Summary
Method Summary
Public MethodsModifier and TypeMethodDescriptionvoidcalculate(long tStart, long tEnd, DataProcessor dataProcessor) Calculates values for the specified time range.(package private) StringReturn the RPN expression for this CDef.Methods inherited from class Source
getName, getTimestamps, getValues, setTimestamps, setValuesModifier and TypeMethodDescription(package private) StringgetName()Returns the source name.(package private) long[]The time, in seconds since the epoch, of each recorded value.(package private) double[]Returns the data values.(package private) voidsetTimestamps(long[] timestamps) Sets the timestamps.(package private) voidsetValues(double[] values) Sets the data values.
Field Details
rpnExpression
The RPN expression that computes this source's values.
Constructor Details
CDef
Method Details
getRpnExpression
calculate
Calculates values for the specified time range.- Specified by:
calculatein interfaceNonRrdSource- Parameters:
tStart- start time for calculationtEnd- end time for calculationdataProcessor- DataProcessor object for accessing other data sources