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)WeightedSnapshot(Collection<WeightedSnapshot.WeightedSample> values, ConfigurationProperties configurationProperties)Create a newSnapshotwith the given values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.microprofile.metrics.Snapshot.HistogramBucket[]bucketValues()voiddump(OutputStream output)Writes the values of the snapshot to the given stream.ConfigurationPropertiesgetConfigAdapter()doublegetMax()Returns the highest value in the snapshot.doublegetMean()Returns the weighted arithmetic mean of the values in the snapshot.long[]getValues()org.eclipse.microprofile.metrics.Snapshot.PercentileValue[]percentileValues()longsize()Returns the number of values in the snapshot.StringtoString()
-
-
-
Constructor Detail
-
WeightedSnapshot
public WeightedSnapshot(Collection<WeightedSnapshot.WeightedSample> values, ConfigurationProperties configurationProperties)
Create a newSnapshotwith the given values.- Parameters:
values- an unordered set of values in the reservoir
-
WeightedSnapshot
public WeightedSnapshot(Collection<WeightedSnapshot.WeightedSample> values)
-
-
Method Detail
-
size
public long size()
Returns the number of values in the snapshot.- Specified by:
sizein classorg.eclipse.microprofile.metrics.Snapshot- Returns:
- the number of values
-
getMax
public double getMax()
Returns the highest value in the snapshot.- Specified by:
getMaxin classorg.eclipse.microprofile.metrics.Snapshot- Returns:
- the highest 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
-
percentileValues
public org.eclipse.microprofile.metrics.Snapshot.PercentileValue[] percentileValues()
- Specified by:
percentileValuesin classorg.eclipse.microprofile.metrics.Snapshot
-
bucketValues
public org.eclipse.microprofile.metrics.Snapshot.HistogramBucket[] bucketValues()
- Overrides:
bucketValuesin classorg.eclipse.microprofile.metrics.Snapshot
-
getValues
public long[] getValues()
-
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
-
getConfigAdapter
public ConfigurationProperties getConfigAdapter()
-
-