YARN-10456. RM PartitionQueueMetrics records are named QueueMetrics in Simon metrics registry. Contributed by Eric Payne.
This commit is contained in:
parent
992d2c5f4e
commit
577ed175f9
|
@ -168,7 +168,11 @@ public class QueueMetrics implements MetricsSource {
|
||||||
|
|
||||||
protected QueueMetrics(MetricsSystem ms, String queueName, Queue parent,
|
protected QueueMetrics(MetricsSystem ms, String queueName, Queue parent,
|
||||||
boolean enableUserMetrics, Configuration conf) {
|
boolean enableUserMetrics, Configuration conf) {
|
||||||
|
if (this instanceof PartitionQueueMetrics) {
|
||||||
|
registry = new MetricsRegistry(P_RECORD_INFO);
|
||||||
|
} else {
|
||||||
registry = new MetricsRegistry(RECORD_INFO);
|
registry = new MetricsRegistry(RECORD_INFO);
|
||||||
|
}
|
||||||
this.queueName = queueName;
|
this.queueName = queueName;
|
||||||
this.parent = parent != null ? parent.getMetrics() : null;
|
this.parent = parent != null ? parent.getMetrics() : null;
|
||||||
this.users = enableUserMetrics ? new HashMap<String, QueueMetrics>()
|
this.users = enableUserMetrics ? new HashMap<String, QueueMetrics>()
|
||||||
|
|
|
@ -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.server.utils.BuilderUtils;
|
||||||
import org.apache.hadoop.yarn.util.resource.Resources;
|
import org.apache.hadoop.yarn.util.resource.Resources;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -110,6 +111,13 @@ public class TestPartitionQueueMetrics {
|
||||||
checkResources(partitionSource, 0, 0, 0, 200 * GB, 200, 5 * GB, 5, 5);
|
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(rootQueueSource, 0, 0, 0, 200 * GB, 200, 5 * GB, 5, 5);
|
||||||
checkResources(q2Source, 0, 0, 0, 0, 0, 3 * GB, 3, 3);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue