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 29ee0c53106..26ecefd0592 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 @@ public class S3AInstrumentation implements Closeable, MetricsSource { 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 e92ce78b101..972c665438e 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 class ITestS3AMetrics extends AbstractS3ATestBase { 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());