Class CommandHandlerMetrics

java.lang.Object
org.apache.hadoop.ozone.container.common.helpers.CommandHandlerMetrics
All Implemented Interfaces:
org.apache.hadoop.metrics2.MetricsSource

@Private public final class CommandHandlerMetrics extends Object implements org.apache.hadoop.metrics2.MetricsSource
This class collects and exposes metrics for CommandHandlerMetrics.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(Map<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type,CommandHandler> handlerMap)
    Creates a new instance of CommandHandlerMetrics and registers it to the DefaultMetricsSystem.
    void
    getMetrics(org.apache.hadoop.metrics2.MetricsCollector collector, boolean all)
     
    void
    increaseCommandCount(org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type type)
    Increases the count of received commands for the specified command type.
    void
     

    Methods inherited from class java.lang.Object

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

    • SOURCE_NAME

      public static final String SOURCE_NAME
  • Method Details

    • create

      public static CommandHandlerMetrics create(Map<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type,CommandHandler> handlerMap)
      Creates a new instance of CommandHandlerMetrics and registers it to the DefaultMetricsSystem.
      Parameters:
      handlerMap - the map of command types to their corresponding command handlers
      Returns:
      the registered instance of CommandHandlerMetrics
    • increaseCommandCount

      public void increaseCommandCount(org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type type)
      Increases the count of received commands for the specified command type.
      Parameters:
      type - the type of the command for which the count should be increased
    • getMetrics

      public void getMetrics(org.apache.hadoop.metrics2.MetricsCollector collector, boolean all)
      Specified by:
      getMetrics in interface org.apache.hadoop.metrics2.MetricsSource
    • unRegister

      public void unRegister()