Class MetricsServiceImpl

    • Field Summary

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <A> A adaptTo​(java.lang.Class<A> type)
      Adapts the service to the specified type.
      Counter counter​(java.lang.String name)
      Creates a new Counter and registers it under the given name.
      Histogram histogram​(java.lang.String name)
      Creates a new Histogram and registers it under the given name.
      Meter meter​(java.lang.String name)
      Creates a new Meter and registers it under the given name.
      Timer timer​(java.lang.String name)
      Creates a new Timer and registers it under the given name.
      • Methods inherited from class java.lang.Object

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

      • MetricsServiceImpl

        public MetricsServiceImpl()
    • Method Detail

      • timer

        public Timer timer​(java.lang.String name)
        Description copied from interface: MetricsService
        Creates a new Timer and registers it under the given name. If a timer with same name exists then same instance is returned
        Specified by:
        timer in interface MetricsService
        Parameters:
        name - the name of the metric
        Returns:
        a new Timer
      • histogram

        public Histogram histogram​(java.lang.String name)
        Description copied from interface: MetricsService
        Creates a new Histogram and registers it under the given name. If a histogram with same name exists then same instance is returned.
        Specified by:
        histogram in interface MetricsService
        Parameters:
        name - the name of the metric
        Returns:
        a new Histogram
      • counter

        public Counter counter​(java.lang.String name)
        Description copied from interface: MetricsService
        Creates a new Counter and registers it under the given name. If a counter with same name exists then same instance is returned
        Specified by:
        counter in interface MetricsService
        Parameters:
        name - the name of the metric
        Returns:
        a new Counter
      • meter

        public Meter meter​(java.lang.String name)
        Description copied from interface: MetricsService
        Creates a new Meter and registers it under the given name. If a meter with same name exists then same instance is returned
        Specified by:
        meter in interface MetricsService
        Parameters:
        name - the name of the metric
        Returns:
        a new Meter
      • adaptTo

        public <A> A adaptTo​(java.lang.Class<A> type)
        Description copied from interface: MetricsService
        Adapts the service to the specified type. This can be used to get instance to underlying MetricRegistry
        Specified by:
        adaptTo in interface MetricsService
        Type Parameters:
        A - The type to which this metric is to be adapted.
        Parameters:
        type - Class object for the type to which this metric is to be adapted.
        Returns:
        The object, of the specified type, to which this metric has been adapted or null if this metric cannot be adapted to the specified type.