Class MaxReservoir

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

    public class MaxReservoir
    extends java.lang.Object
    implements com.codahale.metrics.Reservoir
    A wrapper around Reservoir that keeps track of the max value sent as an update to this reservoir. Any snapshot returned by the reservoir will return this max value.
    • Constructor Summary

      Constructors 
      Constructor Description
      MaxReservoir​(com.codahale.metrics.Reservoir delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.codahale.metrics.Snapshot getSnapshot()
      Returns a snapshot of the reservoir's values, which has the max value set as the overall max value sent as an update to this reservoir.
      int size()
      Returns the number of values recorded.
      void update​(long value)
      Adds a new recorded value to the reservoir.
      • Methods inherited from class java.lang.Object

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

      • MaxReservoir

        public MaxReservoir​(com.codahale.metrics.Reservoir delegate)
        Parameters:
        delegate - the delegate reservoir to wrap
    • Method Detail

      • size

        public int size()
        Returns the number of values recorded.
        Specified by:
        size in interface com.codahale.metrics.Reservoir
        Returns:
        the number of values recorded
      • update

        public void update​(long value)
        Adds a new recorded value to the reservoir.
        Specified by:
        update in interface com.codahale.metrics.Reservoir
        Parameters:
        value - a new recorded value
      • getSnapshot

        public com.codahale.metrics.Snapshot getSnapshot()
        Returns a snapshot of the reservoir's values, which has the max value set as the overall max value sent as an update to this reservoir.
        Specified by:
        getSnapshot in interface com.codahale.metrics.Reservoir
        Returns:
        a snapshot of the reservoir's values