Class DeltaHdrHistogramReservoir

  • All Implemented Interfaces:
    com.codahale.metrics.Reservoir

    public final class DeltaHdrHistogramReservoir
    extends java.lang.Object
    implements com.codahale.metrics.Reservoir
    A custom wrapping of snapshotting logic on the HdrHistogram. This histogram will always report the last histogram since it was most recently asked for with the getDeltaSnapshot(...) method. This provides local snapshot timing, but with a consistent view for reporting channels about what those snapshots most recently looked like.

    This implementation also supports attaching a single log writer. If a log writer is attached, each time an interval is snapshotted internally, the data will also be written to an hdr log via the writer.

    • Constructor Summary

      Constructors 
      Constructor Description
      DeltaHdrHistogramReservoir​(java.lang.String name, int significantDigits)
      Create a reservoir with a default recorder.
    • Method Summary

      Modifier and Type Method Description
      void attachLogWriter​(org.HdrHistogram.HistogramLogWriter logWriter)  
      DeltaHdrHistogramReservoir copySettings()  
      org.HdrHistogram.Histogram getLastHistogram()  
      com.codahale.metrics.Snapshot getLastSnapshot()  
      org.HdrHistogram.Histogram getNextHdrHistogram()  
      com.codahale.metrics.Snapshot getSnapshot()  
      int size()  
      void update​(long value)  
      void write​(org.HdrHistogram.HistogramLogWriter writer)
      Write the last results via the log writer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeltaHdrHistogramReservoir

        public DeltaHdrHistogramReservoir​(java.lang.String name,
                                          int significantDigits)
        Create a reservoir with a default recorder. This recorder should be suitable for most usage.
        Parameters:
        name - the name to give to the reservoir, for logging purposes
        significantDigits - how many significant digits to track in the reservoir
    • Method Detail

      • 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
        Returns:
        the data accumulated since the reservoir was created, or since the last call to this method
      • getNextHdrHistogram

        public org.HdrHistogram.Histogram getNextHdrHistogram()
      • getLastSnapshot

        public com.codahale.metrics.Snapshot getLastSnapshot()
        Returns:
        last histogram snapshot that was provided by getSnapshot()
      • write

        public void write​(org.HdrHistogram.HistogramLogWriter writer)
        Write the last results via the log writer.
        Parameters:
        writer - the log writer to use
      • attachLogWriter

        public void attachLogWriter​(org.HdrHistogram.HistogramLogWriter logWriter)
      • getLastHistogram

        public org.HdrHistogram.Histogram getLastHistogram()