Class ExpressionStatistic

java.lang.Object
com.arpnetworking.tsdcore.statistics.BaseStatistic
com.arpnetworking.tsdcore.statistics.ExpressionStatistic
All Implemented Interfaces:
Statistic, Serializable

public final class ExpressionStatistic extends BaseStatistic
The aggregation is performed with a user-defined expression. At this time this class is only a place holder, but evaluation of the expression will in theory be moved into each unique instance in the future. Use StatisticFactory for construction.
Author:
Ville Koskela (ville dot koskela at inscopemetrics dot com)
See Also:
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Statistic
      Accessor for the name of the statistic.
      Returns:
      The name of the statistic.
    • createCalculator

      public Accumulator<Void> createCalculator()
      Description copied from interface: Statistic
      Create a Calculator for this statistic.
      Returns:
      The new Calculator instance.
    • getDependencies

      public Set<Statistic> getDependencies()
      Description copied from interface: Statistic
      Accessor for any dependencies.
      Specified by:
      getDependencies in interface Statistic
      Overrides:
      getDependencies in class BaseStatistic
      Returns:
      The Set of Statistic dependencies.
    • calculate

      public Quantity calculate(List<Quantity> unorderedValues)
      Description copied from interface: Statistic
      Compute the statistic from the List of Quantity instances. By default the List of samples is not assumed to be in any particular order. However, any Statistic subclass may implement the marker interface OrderedStatistic indicating a requirement to be provided with samples that are sorted from smallest to largest. In all cases the samples are required to be unified into the same unit (or no unit).
      Parameters:
      unorderedValues - List of samples Quantity instances.
      Returns:
      Computed statistic Quantity instance.
    • calculateAggregations

      public Quantity calculateAggregations(List<AggregatedData> aggregations)
      Description copied from interface: Statistic
      Compute the statistic from the List of AggregatedData instances. By default the List of samples is not assumed to be in any particular order. However, any Statistic subclass may implement the marker interface OrderedStatistic indicating a requirement to be provided with samples that are sorted from smallest to largest. In all cases the samples are required to be unified into the same unit (or no unit).
      Parameters:
      aggregations - Aggregations to combine.
      Returns:
      Computed statistic value.