diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java index 9b47431d76d..b0dc218f3dd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java @@ -475,12 +475,40 @@ public class ResourceManager extends CompositeService protected Dispatcher createDispatcher() { AsyncDispatcher dispatcher = new AsyncDispatcher("RM Event dispatcher"); - GenericEventTypeMetrics genericEventTypeMetrics = + + // Add 4 busy event types. + GenericEventTypeMetrics + nodesListManagerEventTypeMetrics = GenericEventTypeMetricsManager. - create(dispatcher.getName(), NodesListManagerEventType.class); - // We can add more - dispatcher.addMetrics(genericEventTypeMetrics, - genericEventTypeMetrics.getEnumClass()); + create(dispatcher.getName(), NodesListManagerEventType.class); + dispatcher.addMetrics(nodesListManagerEventTypeMetrics, + nodesListManagerEventTypeMetrics + .getEnumClass()); + + GenericEventTypeMetrics + rmNodeEventTypeMetrics = + GenericEventTypeMetricsManager. + create(dispatcher.getName(), RMNodeEventType.class); + dispatcher.addMetrics(rmNodeEventTypeMetrics, + rmNodeEventTypeMetrics + .getEnumClass()); + + GenericEventTypeMetrics + rmAppEventTypeMetrics = + GenericEventTypeMetricsManager. + create(dispatcher.getName(), RMAppEventType.class); + dispatcher.addMetrics(rmAppEventTypeMetrics, + rmAppEventTypeMetrics + .getEnumClass()); + + GenericEventTypeMetrics + rmAppAttemptEventTypeMetrics = + GenericEventTypeMetricsManager. + create(dispatcher.getName(), RMAppAttemptEventType.class); + dispatcher.addMetrics(rmAppAttemptEventTypeMetrics, + rmAppAttemptEventTypeMetrics + .getEnumClass()); + return dispatcher; }