Class LockFreeExponentiallyDecayingReservoirWithExemplars
- All Implemented Interfaces:
com.codahale.metrics.Reservoir
LockFreeExponentiallyDecayingReservoirWithExemplars is based on the codahale
LockFreeExponentiallyDecayingReservoir.java
and adds support for capturing exemplar metadata, maintaining basically every other aspect of its original design.
Exemplar metadata is captured via the provided ExemplarMetadataProvider, which is invoked every time a
sample is selected to be added to the reservoir (ie for certain occurrences of Reservoir.update(long)).
The captured metadata is then exposed in the ExemplarsCapture returned by Reservoir.getSnapshot():
even though the signature of Reservoir.getSnapshot() is unchanged, the returned Snapshot is actually
a concrete implementation of Snapshot that is also guaranteed to implement ExemplarsCapture.
See ExponentiallyDecayingReservoir Copyright 2010-2012 Coda Hale and Yammer, Inc.
Licensed under the Apache License, Version 2.0. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBy default this uses a size of 1028 elements, which offers a 99.9% confidence level with a 5% margin of error assuming a normal distribution, and an alpha factor of 0.015, which heavily biases the reservoir to the past 5 minutes of measurements. -
Method Summary
-
Method Details
-
size
public int size()- Specified by:
sizein interfacecom.codahale.metrics.Reservoir
-
update
public void update(long value) - Specified by:
updatein interfacecom.codahale.metrics.Reservoir
-
getSnapshot
public com.codahale.metrics.Snapshot getSnapshot()- Specified by:
getSnapshotin interfacecom.codahale.metrics.Reservoir
-
builder
-