Commit 682ceec4 by Spencer Gibb

Merge branch 'brenuart-gh354b'

parents dbef27ac 68c731d6
......@@ -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();
......
......@@ -40,6 +40,13 @@ public class DefaultServerMetricNamingTests {
}
@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")
.withTag(DataSourceType.KEY, DataSourceType.COUNTER.getValue())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment