HADOOP-15442. ITestS3AMetrics.testMetricsRegister can't know metrics source's name.

Contributed by Sean Mackrory.
This commit is contained in:
Steve Loughran 2018-05-15 16:13:56 +01:00
parent 2bb647bb91
commit b670837469
2 changed files with 0 additions and 8 deletions

View File

@ -267,9 +267,6 @@ private void registerAsMetricsSource(URI name) {
number = ++metricsSourceNameCounter; number = ++metricsSourceNameCounter;
} }
String msName = METRICS_SOURCE_BASENAME + number; String msName = METRICS_SOURCE_BASENAME + number;
if (number > 1) {
msName = msName + number;
}
metricsSourceName = msName + "-" + name.getHost(); metricsSourceName = msName + "-" + name.getHost();
metricsSystem.register(metricsSourceName, "", this); metricsSystem.register(metricsSourceName, "", this);
} }

View File

@ -38,11 +38,6 @@ public void testMetricsRegister()
Path dest = path("testMetricsRegister"); Path dest = path("testMetricsRegister");
ContractTestUtils.touch(fs, dest); ContractTestUtils.touch(fs, dest);
String targetMetricSource = "S3AMetrics1" + "-" + fs.getBucket();
assertNotNull("No metrics under test fs for " + targetMetricSource,
fs.getInstrumentation().getMetricsSystem()
.getSource(targetMetricSource));
MutableCounterLong fileCreated = MutableCounterLong fileCreated =
(MutableCounterLong) fs.getInstrumentation().getRegistry() (MutableCounterLong) fs.getInstrumentation().getRegistry()
.get(Statistic.FILES_CREATED.getSymbol()); .get(Statistic.FILES_CREATED.getSymbol());