You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by jb...@apache.org on 2021/07/15 14:48:25 UTC
[hadoop] branch branch-3.3 updated: YARN-10456. RM
PartitionQueueMetrics records are named QueueMetrics in Simon metrics
registry. Contributed by Eric Payne.
This is an automated email from the ASF dual-hosted git repository.
jbrennan pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new b348106 YARN-10456. RM PartitionQueueMetrics records are named QueueMetrics in Simon metrics registry. Contributed by Eric Payne.
b348106 is described below
commit b3481062e0adb83051b8f3109742bf8755502c06
Author: Jim Brennan <jb...@apache.org>
AuthorDate: Thu Jul 15 14:23:31 2021 +0000
YARN-10456. RM PartitionQueueMetrics records are named QueueMetrics in Simon metrics registry. Contributed by Eric Payne.
(cherry picked from commit 632f64cadb1dfd8f0940e350b9314b4d4f8eda4b)
---
.../yarn/server/resourcemanager/scheduler/QueueMetrics.java | 6 +++++-
.../resourcemanager/scheduler/TestPartitionQueueMetrics.java | 8 ++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java
index 1e42e7a..7c275f7 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java
@@ -167,7 +167,11 @@ public class QueueMetrics implements MetricsSource {
public QueueMetrics(MetricsSystem ms, String queueName, Queue parent,
boolean enableUserMetrics, Configuration conf) {
- registry = new MetricsRegistry(RECORD_INFO);
+ if (this instanceof PartitionQueueMetrics) {
+ registry = new MetricsRegistry(P_RECORD_INFO);
+ } else {
+ registry = new MetricsRegistry(RECORD_INFO);
+ }
this.queueName = queueName;
this.parent = parent != null ? parent.getMetrics() : null;
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/TestPartitionQueueMetrics.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/TestPartitionQueueMetrics.java
index eb240d1..8ee6c94 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/TestPartitionQueueMetrics.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/TestPartitionQueueMetrics.java
@@ -37,6 +37,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueueM
import org.apache.hadoop.yarn.server.utils.BuilderUtils;
import org.apache.hadoop.yarn.util.resource.Resources;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -110,6 +111,13 @@ public class TestPartitionQueueMetrics {
checkResources(partitionSource, 0, 0, 0, 200 * GB, 200, 5 * GB, 5, 5);
checkResources(rootQueueSource, 0, 0, 0, 200 * GB, 200, 5 * GB, 5, 5);
checkResources(q2Source, 0, 0, 0, 0, 0, 3 * GB, 3, 3);
+
+ PartitionQueueMetrics pq1 =
+ new PartitionQueueMetrics(ms, "root.q1", parentQueue, true, CONF, "x");
+ Assert.assertTrue("Name of registry should be \""
+ + PartitionQueueMetrics.P_RECORD_INFO.name() + "\", but was \""
+ + pq1.registry.info().name() + "\".", pq1.registry.info().name()
+ .compareTo(PartitionQueueMetrics.P_RECORD_INFO.name()) == 0);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org