Class MutableMetricsFactory

java.lang.Object
org.apache.hadoop.metrics2.lib.MutableMetricsFactory

@Private @Evolving public class MutableMetricsFactory extends Object
  • Constructor Details

    • MutableMetricsFactory

      public MutableMetricsFactory()
  • Method Details

    • newForField

      protected MutableMetric newForField(Field field, Metric annotation)
      Override to handle custom mutable metrics for fields
      Parameters:
      field - of the metric
      annotation - of the field
      Returns:
      a new metric object or null
    • newForMethod

      protected MutableMetric newForMethod(Object source, Method method, Metric annotation)
      Override to handle custom mutable metrics for methods
      Parameters:
      source - the metrics source object
      method - to return the metric
      annotation - of the method
      Returns:
      a new metric object or null
    • getInfo

      protected MetricsInfo getInfo(Metric annotation, Field field)
    • getName

      protected String getName(Field field)
    • getInfo

      protected MetricsInfo getInfo(Metric annotation, Method method)
    • getInfo

      protected MetricsInfo getInfo(Class<?> cls, Metrics annotation)
    • getName

      protected String getName(Method method)
      Parameters:
      method - input method.
      Returns:
      Remove the prefix "get", if any, from the method name. Return the capacitalized method name."
    • getInfo

      protected MetricsInfo getInfo(Metric annotation, String defaultName)