Class Meter

java.lang.Object
com.codahale.metrics.Meter
All Implemented Interfaces:
Counting, Metered, Metric

public class Meter extends Object implements Metered
A meter metric which measures mean throughput and one-, five-, and fifteen-minute moving average throughputs.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Meter.
    Meter(Clock clock)
    Creates a new Meter.
    Meter(MovingAverages movingAverages)
    Creates a new Meter.
    Meter(MovingAverages movingAverages, Clock clock)
    Creates a new Meter.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the number of events which have been marked.
    double
    Returns the fifteen-minute moving average rate at which events have occurred since the meter was created.
    double
    Returns the five-minute moving average rate at which events have occurred since the meter was created.
    double
    Returns the mean rate at which events have occurred since the meter was created.
    double
    Returns the one-minute moving average rate at which events have occurred since the meter was created.
    void
    Mark the occurrence of an event.
    void
    mark(long n)
    Mark the occurrence of a given number of events.

    Methods inherited from class java.lang.Object

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

    • Meter

      public Meter(MovingAverages movingAverages)
      Creates a new Meter.
      Parameters:
      movingAverages - the MovingAverages implementation to use
    • Meter

      public Meter()
      Creates a new Meter.
    • Meter

      public Meter(Clock clock)
      Creates a new Meter.
      Parameters:
      clock - the clock to use for the meter ticks
    • Meter

      public Meter(MovingAverages movingAverages, Clock clock)
      Creates a new Meter.
      Parameters:
      movingAverages - the MovingAverages implementation to use
      clock - the clock to use for the meter ticks
  • Method Details

    • 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()
      Description copied from interface: Metered
      Returns the number of events which have been marked.
      Specified by:
      getCount in interface Counting
      Specified by:
      getCount in interface Metered
      Returns:
      the number of events which have been marked
    • getFifteenMinuteRate

      public double getFifteenMinuteRate()
      Description copied from interface: Metered
      Returns the fifteen-minute moving average rate at which events have occurred since the meter was created.
      Specified by:
      getFifteenMinuteRate in interface Metered
      Returns:
      the fifteen-minute moving average rate at which events have occurred since the meter was created
    • getFiveMinuteRate

      public double getFiveMinuteRate()
      Description copied from interface: Metered
      Returns the five-minute moving average rate at which events have occurred since the meter was created.
      Specified by:
      getFiveMinuteRate in interface Metered
      Returns:
      the five-minute moving average rate at which events have occurred since the meter was created
    • getMeanRate

      public double getMeanRate()
      Description copied from interface: Metered
      Returns the mean rate at which events have occurred since the meter was created.
      Specified by:
      getMeanRate in interface Metered
      Returns:
      the mean rate at which events have occurred since the meter was created
    • getOneMinuteRate

      public double getOneMinuteRate()
      Description copied from interface: Metered
      Returns the one-minute moving average rate at which events have occurred since the meter was created.
      Specified by:
      getOneMinuteRate in interface Metered
      Returns:
      the one-minute moving average rate at which events have occurred since the meter was created