All Implemented Interfaces:
NonRrdSource

class VDefextends Source implements NonRrdSource
RRD VDEF (Variable Definition) implementation.
Creates computed data sources by applying aggregation functions to existing data sources.
  • Field Details

    • defName

      private final String defName
      Name other definitions use to refer to this one.
    • var

      private final Variable var
      The variable holding the defined value.
  • Constructor Details

    • VDef

      VDef(String name, String defName, Variable aggr)
      Create a computed data source backed by an aggregation over another source.
      Parameters:
      name - the name this source is published under
      defName - the name of the source this variable aggregates
      aggr - the aggregation to apply to that source
  • Method Details

    • getDefName

      String getDefName()
      Read the def name this source is published under.
      Returns:
      the def name
    • calculate

      public void calculate(long tStart, long tEnd, DataProcessor dataProcessor)
      Aggregate the named source over the requested time range into this variable.
      Specified by:
      calculate in interface NonRrdSource
      Parameters:
      tStart - start time for calculation
      tEnd - end time for calculation
      dataProcessor - DataProcessor object used to look up the named source
    • getValue

      public Variable.Value getValue()
      Value from the wrapped variable.
      Returns:
      the value the wrapped Variable currently reports
    • getValues

      double[] getValues()
      Description copied from class: Source
      Returns the data values.
      Overrides:
      getValues in class Source
      Returns:
      the values array