Class LockFreeExponentiallyDecayingReservoirWithExemplars

java.lang.Object
com.palantir.tritium.metrics.registry.LockFreeExponentiallyDecayingReservoirWithExemplars
All Implemented Interfaces:
com.codahale.metrics.Reservoir

public final class LockFreeExponentiallyDecayingReservoirWithExemplars extends Object implements 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

  • Method Details

    • size

      public int size()
      Specified by:
      size in interface com.codahale.metrics.Reservoir
    • update

      public void update(long value)
      Specified by:
      update in interface com.codahale.metrics.Reservoir
    • getSnapshot

      public com.codahale.metrics.Snapshot getSnapshot()
      Specified by:
      getSnapshot in interface com.codahale.metrics.Reservoir
    • builder