@Test public void sanitizeMetricName() throws Exception { assertEquals("_hoge", Collector.sanitizeMetricName("0hoge")); assertEquals("foo_bar0", Collector.sanitizeMetricName("foo.bar0")); assertEquals(":baz::", Collector.sanitizeMetricName(":baz::")); }
public static String sanitizeMetricName(String metricName) { return SANITIZE_BODY_PATTERN.matcher( SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_") ).replaceAll("_"); }
Collector { public static String sanitizeMetricName(String metricName) { return SANITIZE_BODY_PATTERN.matcher( SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_") ).replaceAll("_"); } }
Collector { public static String sanitizeMetricName(String metricName) { return SANITIZE_BODY_PATTERN.matcher( SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_") ).replaceAll("_"); }  }
Collector { public static String sanitizeMetricName(String metricName) { return SANITIZE_BODY_PATTERN.matcher( SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_") ).replaceAll("_"); }  abstract List<MetricFamilySamples> collect(); T register(); T register(CollectorRegistry registry); static String sanitizeMetricName(String metricName); static String doubleToGoString(double d); }
Collector { public static String sanitizeMetricName(String metricName) { return SANITIZE_BODY_PATTERN.matcher( SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_") ).replaceAll("_"); }  abstract List<MetricFamilySamples> collect(); T register(); T register(CollectorRegistry registry); static String sanitizeMetricName(String metricName); static String doubleToGoString(double d); static final double NANOSECONDS_PER_SECOND; static final double MILLISECONDS_PER_SECOND; }