Class HistogramImpl
- java.lang.Object
-
- fish.payara.microprofile.metrics.impl.HistogramImpl
-
- All Implemented Interfaces:
org.eclipse.microprofile.metrics.Counting,org.eclipse.microprofile.metrics.Histogram,org.eclipse.microprofile.metrics.Metric,org.eclipse.microprofile.metrics.Sampling
@Vetoed public class HistogramImpl extends Object implements org.eclipse.microprofile.metrics.Histogram
A metric which calculates the distribution of a value.- See Also:
- Accurately computing running variance
-
-
Constructor Summary
Constructors Constructor Description HistogramImpl()Creates a newHistogramImplusing anExponentiallyDecayingReservoir.HistogramImpl(Reservoir reservoir)Creates a newHistogramImplwith the given reservoir.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCount()Returns the number of values recorded.org.eclipse.microprofile.metrics.SnapshotgetSnapshot()longgetSum()StringtoString()voidupdate(int value)Adds a recorded value.voidupdate(long value)Adds a recorded value.
-
-
-
Constructor Detail
-
HistogramImpl
public HistogramImpl()
Creates a newHistogramImplusing anExponentiallyDecayingReservoir.
-
HistogramImpl
public HistogramImpl(Reservoir reservoir)
Creates a newHistogramImplwith the given reservoir.- Parameters:
reservoir- the reservoir to create a histogram from
-
-
Method Detail
-
update
public void update(int value)
Adds a recorded value.- Specified by:
updatein interfaceorg.eclipse.microprofile.metrics.Histogram- Parameters:
value- the length of the value
-
update
public void update(long value)
Adds a recorded value.- Specified by:
updatein interfaceorg.eclipse.microprofile.metrics.Histogram- Parameters:
value- the length of the value
-
getCount
public long getCount()
Returns the number of values recorded.- Specified by:
getCountin interfaceorg.eclipse.microprofile.metrics.Counting- Specified by:
getCountin interfaceorg.eclipse.microprofile.metrics.Histogram- Returns:
- the number of values recorded
-
getSum
public long getSum()
- Specified by:
getSumin interfaceorg.eclipse.microprofile.metrics.Histogram
-
getSnapshot
public org.eclipse.microprofile.metrics.Snapshot getSnapshot()
- Specified by:
getSnapshotin interfaceorg.eclipse.microprofile.metrics.Histogram- Specified by:
getSnapshotin interfaceorg.eclipse.microprofile.metrics.Sampling
-
-