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
Base class for percentile based statistics.
- Author:
- Brandon Arp (brandon dot arp at inscopemetrics dot com)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Calculator computing the percentile of values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateAggregations
(List<AggregatedData> aggregations) Compute the statistic from theList
ofAggregatedData
instances.Create aCalculator
for this statistic.boolean
Accessor for any aliases of the statistic.Accessor for any dependencies.getName()
Accessor for the name of the statistic.double
Accessor for the percentile from 0 to 100 (inclusive).int
hashCode()
Methods inherited from class com.arpnetworking.tsdcore.statistics.BaseStatistic
toString
-
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
Description copied from interface:Statistic
Accessor for the name of the statistic. -
getAliases
Description copied from interface:Statistic
Accessor for any aliases of the statistic.- Specified by:
getAliases
in interfaceStatistic
- Overrides:
getAliases
in classBaseStatistic
- Returns:
- The aliases of the statistic.
-
createCalculator
Description copied from interface:Statistic
Create aCalculator
for this statistic.- Specified by:
createCalculator
in interfaceStatistic
- Returns:
- The new
Calculator
instance.
-
getDependencies
Description copied from interface:Statistic
Accessor for any dependencies.- Specified by:
getDependencies
in interfaceStatistic
- Overrides:
getDependencies
in classBaseStatistic
- Returns:
- The
Set
ofStatistic
dependencies.
-
calculate
Description copied from interface:Statistic
Compute the statistic from theList
ofQuantity
instances. By default theList
of samples is not assumed to be in any particular order. However, anyStatistic
subclass may implement the marker interfaceOrderedStatistic
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). -
calculateAggregations
Description copied from interface:Statistic
Compute the statistic from theList
ofAggregatedData
instances. By default theList
of samples is not assumed to be in any particular order. However, anyStatistic
subclass may implement the marker interfaceOrderedStatistic
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 interfaceStatistic
- Parameters:
aggregations
- Aggregations to combine.- Returns:
- Computed statistic value.
-
hashCode
public int hashCode()- Overrides:
hashCode
in classBaseStatistic
-
equals
- Overrides:
equals
in classBaseStatistic
-