Class Metrics

java.lang.Object
com.erudika.para.core.metrics.Metrics

public final class Metrics extends Object
Helper methods for working with performance metrics.
Author:
Alex Bogdanovski [alex@erudika.com]
  • Nested Class Summary Link icon

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    An auto-closeable class that manages timers for both the overall system as well as specific application.
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name of the default system @{link MetricRegistry}.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    static com.codahale.metrics.Counter
    counter(String appid, Class<?> clazz, String... names)
    Creates a new counter for a particular class and method for a specific application.
    static String
    getClassName(Class<?> clazz)
     
    time(String appid, Class<?> clazz, String... names)
    Instantiate timing of a particular class and method for a specific application.

    Methods inherited from class java.lang.Object Link icon

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details Link icon

    • SYSTEM_METRICS_NAME Link icon

      public static final String SYSTEM_METRICS_NAME
      The name of the default system @{link MetricRegistry}.
      See Also:
  • Method Details Link icon

    • time Link icon

      public static Metrics.Context time(String appid, Class<?> clazz, String... names)
      Instantiate timing of a particular class and method for a specific application.
      Parameters:
      appid - the application that invoked the request
      clazz - the Class to be timed
      names - one or more unique names to identify the timer - usually a method name
      Returns:
      a closeable context that encapsulates the timed method
    • counter Link icon

      public static com.codahale.metrics.Counter counter(String appid, Class<?> clazz, String... names)
      Creates a new counter for a particular class and method for a specific application.
      Parameters:
      appid - the application that invoked the request
      clazz - the Class to be counted
      names - one or more unique names to identify the counter - usually a method name
      Returns:
      a counter
    • getClassName Link icon

      public static String getClassName(Class<?> clazz)