Class WeightedSnapshot
- java.lang.Object
-
- org.eclipse.microprofile.metrics.Snapshot
-
- fish.payara.microprofile.metrics.impl.WeightedSnapshot
-
public class WeightedSnapshot extends org.eclipse.microprofile.metrics.SnapshotA statistical snapshot of aWeightedSnapshot.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWeightedSnapshot.WeightedSampleA single sample item with value and its weights forWeightedSnapshot.
-
Constructor Summary
Constructors Constructor Description WeightedSnapshot(Collection<WeightedSnapshot.WeightedSample> values)Create a newSnapshotwith the given values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(OutputStream output)Writes the values of the snapshot to the given stream.longgetMax()Returns the highest value in the snapshot.doublegetMean()Returns the weighted arithmetic mean of the values in the snapshot.longgetMin()Returns the lowest value in the snapshot.doublegetStdDev()Returns the weighted standard deviation of the values in the snapshot.doublegetValue(double quantile)Returns the value at the given quantile.long[]getValues()Returns the entire set of values in the snapshot.intsize()Returns the number of values in the snapshot.StringtoString()
-
-
-
Constructor Detail
-
WeightedSnapshot
public WeightedSnapshot(Collection<WeightedSnapshot.WeightedSample> values)
Create a newSnapshotwith the given values.- Parameters:
values- an unordered set of values in the reservoir
-
-
Method Detail
-
getValue
public double getValue(double quantile)
Returns the value at the given quantile.- Specified by:
getValuein classorg.eclipse.microprofile.metrics.Snapshot- Parameters:
quantile- a given quantile, in[0..1]- Returns:
- the value in the distribution at
quantile
-
size
public int size()
Returns the number of values in the snapshot.- Specified by:
sizein classorg.eclipse.microprofile.metrics.Snapshot- Returns:
- the number of values
-
getValues
public long[] getValues()
Returns the entire set of values in the snapshot.- Specified by:
getValuesin classorg.eclipse.microprofile.metrics.Snapshot- Returns:
- the entire set of values
-
getMax
public long getMax()
Returns the highest value in the snapshot.- Specified by:
getMaxin classorg.eclipse.microprofile.metrics.Snapshot- Returns:
- the highest value
-
getMin
public long getMin()
Returns the lowest value in the snapshot.- Specified by:
getMinin classorg.eclipse.microprofile.metrics.Snapshot- Returns:
- the lowest value
-
getMean
public double getMean()
Returns the weighted arithmetic mean of the values in the snapshot.- Specified by:
getMeanin classorg.eclipse.microprofile.metrics.Snapshot- Returns:
- the weighted arithmetic mean
-
getStdDev
public double getStdDev()
Returns the weighted standard deviation of the values in the snapshot.- Specified by:
getStdDevin classorg.eclipse.microprofile.metrics.Snapshot- Returns:
- the weighted standard deviation value
-
dump
public void dump(OutputStream output)
Writes the values of the snapshot to the given stream.- Specified by:
dumpin classorg.eclipse.microprofile.metrics.Snapshot- Parameters:
output- an output stream
-
-