Class Meter

  • All Implemented Interfaces:
    org.xbib.metrics.api.Metered, org.xbib.metrics.api.Metric

    public class Meter
    extends java.lang.Object
    implements org.xbib.metrics.api.Metered
    A meter metric which measures mean throughput and one-, five-, and fifteen-minute exponentially-weighted moving average throughputs.
    See Also:
    ExpWeightedMovingAverage
    • Constructor Summary

      Constructors 
      Constructor Description
      Meter​(java.util.concurrent.ScheduledExecutorService executorService)
      Creates a new Meter.
      Meter​(java.util.concurrent.ScheduledExecutorService executorService, org.xbib.metrics.api.Clock clock)
      Creates a new Meter.
    • Constructor Detail

      • Meter

        public Meter​(java.util.concurrent.ScheduledExecutorService executorService)
        Creates a new Meter.
        Parameters:
        executorService - the executor service
      • Meter

        public Meter​(java.util.concurrent.ScheduledExecutorService executorService,
                     org.xbib.metrics.api.Clock clock)
        Creates a new Meter.
        Parameters:
        executorService - the executor service
        clock - the clock to use for the meter ticks
    • Method Detail

      • start

        public void start​(long intervalSeconds)
      • stop

        public void stop()
      • shutdown

        public void shutdown()
      • mark

        public void mark()
        Mark the occurrence of an event.
      • mark

        public void mark​(long n)
        Mark the occurrence of a given number of events.
        Parameters:
        n - the number of events
      • getCount

        public long getCount()
        Specified by:
        getCount in interface org.xbib.metrics.api.Metered
      • getFifteenMinuteRate

        public double getFifteenMinuteRate()
        Specified by:
        getFifteenMinuteRate in interface org.xbib.metrics.api.Metered
      • getFiveMinuteRate

        public double getFiveMinuteRate()
        Specified by:
        getFiveMinuteRate in interface org.xbib.metrics.api.Metered
      • getMeanRate

        public double getMeanRate()
        Specified by:
        getMeanRate in interface org.xbib.metrics.api.Metered
      • getOneMinuteRate

        public double getOneMinuteRate()
        Specified by:
        getOneMinuteRate in interface org.xbib.metrics.api.Metered
      • elapsed

        public long elapsed()