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 newHistogramImpl
using anExponentiallyDecayingReservoir
.HistogramImpl(Reservoir reservoir)
Creates a newHistogramImpl
with the given reservoir.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCount()
Returns the number of values recorded.org.eclipse.microprofile.metrics.Snapshot
getSnapshot()
long
getSum()
String
toString()
void
update(int value)
Adds a recorded value.void
update(long value)
Adds a recorded value.
-
-
-
Constructor Detail
-
HistogramImpl
public HistogramImpl()
Creates a newHistogramImpl
using anExponentiallyDecayingReservoir
.
-
HistogramImpl
public HistogramImpl(Reservoir reservoir)
Creates a newHistogramImpl
with 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:
update
in interfaceorg.eclipse.microprofile.metrics.Histogram
- Parameters:
value
- the length of the value
-
update
public void update(long value)
Adds a recorded value.- Specified by:
update
in interfaceorg.eclipse.microprofile.metrics.Histogram
- Parameters:
value
- the length of the value
-
getCount
public long getCount()
Returns the number of values recorded.- Specified by:
getCount
in interfaceorg.eclipse.microprofile.metrics.Counting
- Specified by:
getCount
in interfaceorg.eclipse.microprofile.metrics.Histogram
- Returns:
- the number of values recorded
-
getSum
public long getSum()
- Specified by:
getSum
in interfaceorg.eclipse.microprofile.metrics.Histogram
-
getSnapshot
public org.eclipse.microprofile.metrics.Snapshot getSnapshot()
- Specified by:
getSnapshot
in interfaceorg.eclipse.microprofile.metrics.Histogram
- Specified by:
getSnapshot
in interfaceorg.eclipse.microprofile.metrics.Sampling
-
-