Class LockFreeExponentiallyDecayingReservoir
java.lang.Object
com.palantir.tritium.metrics.registry.LockFreeExponentiallyDecayingReservoir
- All Implemented Interfaces:
com.codahale.metrics.Reservoir
@Deprecated
public final class LockFreeExponentiallyDecayingReservoir
extends Object
implements com.codahale.metrics.Reservoir
Deprecated.
LockFreeExponentiallyDecayingReservoir is based closely on the codahale
ExponentiallyDecayingReservoir.java, however it provides looser guarantees while completely avoiding locks.
This implementation is being contributed upstream:
metrics#1656
Looser guarantees:
- Updates which occur concurrently with rescaling may be discarded if the orphaned state node is updated after
rescale has replaced it. This condition has a greater probability as the rescale interval is reduced due to the
increased frequency of rescaling.
rescaleThresholdNanosvalues below 30 seconds are not recommended. - Given a small rescale threshold, updates may attempt to rescale into a new bucket, but lose the CAS race and update into a newer bucket than expected. In these cases the measurement weight is reduced accordingly.
- In the worst case, all concurrent threads updating the reservoir may attempt to rescale rather than a single thread holding an exclusive write lock. It's expected that the configuration is set such that rescaling is substantially less common than updating at peak load. Even so, when size is reasonably small it can be more efficient to rescale than to park and context switch.
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 classDeprecated.By 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()Deprecated.- Specified by:
sizein interfacecom.codahale.metrics.Reservoir
-
update
public void update(long value) Deprecated.- Specified by:
updatein interfacecom.codahale.metrics.Reservoir
-
getSnapshot
public com.codahale.metrics.Snapshot getSnapshot()Deprecated.- Specified by:
getSnapshotin interfacecom.codahale.metrics.Reservoir
-
builder
Deprecated.
-
LockFreeExponentiallyDecayingReservoir.