diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java index 29ee0c5310..26ecefd059 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java @@ -267,9 +267,6 @@ private void registerAsMetricsSource(URI name) { number = ++metricsSourceNameCounter; } String msName = METRICS_SOURCE_BASENAME + number; - if (number > 1) { - msName = msName + number; - } metricsSourceName = msName + "-" + name.getHost(); metricsSystem.register(metricsSourceName, "", this); } diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AMetrics.java b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AMetrics.java index e92ce78b10..972c665438 100644 --- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AMetrics.java +++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AMetrics.java @@ -38,11 +38,6 @@ public void testMetricsRegister() Path dest = path("testMetricsRegister"); 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) fs.getInstrumentation().getRegistry() .get(Statistic.FILES_CREATED.getSymbol());