Merge branch 'brenuart-gh354b'
This commit is contained in:
@@ -48,7 +48,7 @@ public class DefaultServoMetricNaming implements ServoMetricNaming {
|
||||
private String handleMetric(MonitorConfig config, TagList tags) {
|
||||
String type = cleanValue(tags.getTag(DataSourceType.KEY), false);
|
||||
String instanceName = cleanValue(tags.getTag("instance"), false);
|
||||
String name = cleanupIllegalCharacters(config.getName(), false);
|
||||
String name = cleanupIllegalCharacters(config.getName(), true);
|
||||
String statistic = cleanValue(tags.getTag("statistic"), false);
|
||||
|
||||
StringBuilder nameBuilder = new StringBuilder();
|
||||
@@ -74,7 +74,7 @@ public class DefaultServoMetricNaming implements ServoMetricNaming {
|
||||
String domain = cleanValue(tags.getTag(JMX_DOMAIN_KEY), true);
|
||||
String type = cleanValue(tags.getTag("Jmx.type"), false);
|
||||
String instanceName = cleanValue(tags.getTag("Jmx.instance"), false);
|
||||
String name = cleanValue(tags.getTag("Jmx.name"), false);
|
||||
String name = cleanValue(tags.getTag("Jmx.name"), true);
|
||||
String fieldName = cleanupIllegalCharacters(config.getName(), false);
|
||||
|
||||
StringBuilder nameBuilder = new StringBuilder();
|
||||
|
||||
@@ -39,6 +39,13 @@ public class DefaultServerMetricNamingTests {
|
||||
assertThat(name, is(equalTo("servo.testmetric")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nameWithPeriodWorks() {
|
||||
MonitorConfig config = MonitorConfig.builder("test.Metric") .build();
|
||||
String name = naming.getName(new Metric(config, System.currentTimeMillis(), 0));
|
||||
assertThat(name, is(equalTo("servo.test.metric")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void typeTagWorks() {
|
||||
MonitorConfig config = MonitorConfig.builder("testMetric")
|
||||
|
||||
Reference in New Issue
Block a user