HADOOP-15442. ITestS3AMetrics.testMetricsRegister can't know metrics source's name.
Contributed by Sean Mackrory.
(cherry picked from commit b670837469
)
This commit is contained in:
parent
2bb39330a4
commit
a0cb1e0941
|
@ -267,9 +267,6 @@ public class S3AInstrumentation implements Closeable, MetricsSource {
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,11 +38,6 @@ public class ITestS3AMetrics extends AbstractS3ATestBase {
|
||||||
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());
|
||||||
|
|
Loading…
Reference in New Issue