Class NamedMeter

  • All Implemented Interfaces:
    com.codahale.metrics.Counting, com.codahale.metrics.Metered, com.codahale.metrics.Metric

    @Beta
    public class NamedMeter
    extends com.codahale.metrics.Meter
    A Metrics Meter that knows its own name.
    • Method Detail

      • of

        public static NamedMeter of​(String name,
                                    com.codahale.metrics.Meter meterDelegate)
        Creates a new NamedMeter which delegates to the provided Meter.
        Parameters:
        name - the name for this meter
        meterDelegate - the Meter delegate that method calls will be forwarded to
        Returns:
        a new instance
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        the name of this Meter
        Implementation Note:
        This does not include any additional information from the Meter, because calling the methods in a Meter cause changes to occur internally (since it is time-dependent) and a toString() should not cause any internal state changes in an object.
      • getName

        public String getName()
        Get the name of the Meter.
      • getMeter

        public com.codahale.metrics.Meter getMeter()
        Allows access to the decorated Meter instance. Normally this won't be necessary since calls to Metered methods are delegated to and because this class extends Meter, which allows it to be passed directly to any methods that accept a Meter, e.g. a Timer requires a Meter in one of its constructors.
      • mark

        public void mark()
        Overrides:
        mark in class com.codahale.metrics.Meter
      • mark

        public void mark​(long n)
        Overrides:
        mark in class com.codahale.metrics.Meter
      • getCount

        public long getCount()
        Specified by:
        getCount in interface com.codahale.metrics.Counting
        Specified by:
        getCount in interface com.codahale.metrics.Metered
        Overrides:
        getCount in class com.codahale.metrics.Meter
      • getFifteenMinuteRate

        public double getFifteenMinuteRate()
        Specified by:
        getFifteenMinuteRate in interface com.codahale.metrics.Metered
        Overrides:
        getFifteenMinuteRate in class com.codahale.metrics.Meter
      • getFiveMinuteRate

        public double getFiveMinuteRate()
        Specified by:
        getFiveMinuteRate in interface com.codahale.metrics.Metered
        Overrides:
        getFiveMinuteRate in class com.codahale.metrics.Meter
      • getMeanRate

        public double getMeanRate()
        Specified by:
        getMeanRate in interface com.codahale.metrics.Metered
        Overrides:
        getMeanRate in class com.codahale.metrics.Meter
      • getOneMinuteRate

        public double getOneMinuteRate()
        Specified by:
        getOneMinuteRate in interface com.codahale.metrics.Metered
        Overrides:
        getOneMinuteRate in class com.codahale.metrics.Meter