Class TPStatistic

java.lang.Object
com.arpnetworking.tsdcore.statistics.BaseStatistic
com.arpnetworking.tsdcore.statistics.TPStatistic
All Implemented Interfaces:
OrderedStatistic, Statistic, Serializable
Direct Known Subclasses:
MedianStatistic

public class TPStatistic extends BaseStatistic implements OrderedStatistic
Base class for percentile based statistics.
Author:
Brandon Arp (brandon dot arp at inscopemetrics dot com)
See Also:
  • Constructor Details

    • TPStatistic

      public TPStatistic(double percentile)
      Public constructor.
      Parameters:
      percentile - the percentile value to compute
  • Method Details

    • getPercentile

      public double getPercentile()
      Accessor for the percentile from 0 to 100 (inclusive).
      Returns:
      The percentile.
    • getName

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

      public Set<String> getAliases()
      Description copied from interface: Statistic
      Accessor for any aliases of the statistic.
      Specified by:
      getAliases in interface Statistic
      Overrides:
      getAliases in class BaseStatistic
      Returns:
      The aliases of the statistic.
    • createCalculator

      public Calculator<Void> createCalculator()
      Description copied from interface: Statistic
      Create a Calculator for this statistic.
      Specified by:
      createCalculator in interface 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> orderedValues)
      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).
      Specified by:
      calculate in interface Statistic
      Parameters:
      orderedValues - 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).
      Specified by:
      calculateAggregations in interface Statistic
      Parameters:
      aggregations - Aggregations to combine.
      Returns:
      Computed statistic value.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BaseStatistic
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class BaseStatistic