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 -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandHandlerMetricscreate(Map<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type, CommandHandler> handlerMap) Creates a new instance of CommandHandlerMetrics and registers it to the DefaultMetricsSystem.voidgetMetrics(org.apache.hadoop.metrics2.MetricsCollector collector, boolean all) voidincreaseCommandCount(org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto.Type type) Increases the count of received commands for the specified command type.void
-
Field Details
-
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:
getMetricsin interfaceorg.apache.hadoop.metrics2.MetricsSource
-
unRegister
public void unRegister()
-