@Test public void testMetricNameQuoting() { assertEquals("zz", getOpenMetricsMetricName("zz")); assertEquals("_", getOpenMetricsMetricName("č")); assertEquals("__", getOpenMetricsMetricName("čž")); assertEquals("___", getOpenMetricsMetricName(":čž")); assertEquals("_", getOpenMetricsMetricName("__")); assertEquals("a__b", getOpenMetricsMetricName("a:_b")); assertEquals("hello_hello", getOpenMetricsMetricName("helloŘhello")); }
static String getOpenMetricsMetricName(String name) { String out = name; out = out.replace("__", USCORE); out = out.replaceAll("[^\\w]", USCORE); return out; }
OpenMetricsExporter implements Exporter { static String getOpenMetricsMetricName(String name) { String out = name; out = out.replace("__", USCORE); out = out.replaceAll("[^\\w]", USCORE); return out; } }
OpenMetricsExporter implements Exporter { static String getOpenMetricsMetricName(String name) { String out = name; out = out.replace("__", USCORE); out = out.replaceAll("[^\\w]", USCORE); return out; } OpenMetricsExporter(); }
OpenMetricsExporter implements Exporter { static String getOpenMetricsMetricName(String name) { String out = name; out = out.replace("__", USCORE); out = out.replaceAll("[^\\w]", USCORE); return out; } OpenMetricsExporter(); @Override StringBuilder exportOneScope(MetricRegistry.Type scope); @Override StringBuilder exportAllScopes(); @Override StringBuilder exportOneMetric(MetricRegistry.Type scope, MetricID metricID); @Override StringBuilder exportMetricsByName(MetricRegistry.Type scope, String name); @Override String getContentType(); static String quoteHelpText(String value); static String quoteValue(String value); }
OpenMetricsExporter implements Exporter { static String getOpenMetricsMetricName(String name) { String out = name; out = out.replace("__", USCORE); out = out.replaceAll("[^\\w]", USCORE); return out; } OpenMetricsExporter(); @Override StringBuilder exportOneScope(MetricRegistry.Type scope); @Override StringBuilder exportAllScopes(); @Override StringBuilder exportOneMetric(MetricRegistry.Type scope, MetricID metricID); @Override StringBuilder exportMetricsByName(MetricRegistry.Type scope, String name); @Override String getContentType(); static String quoteHelpText(String value); static String quoteValue(String value); static final String SMALLRYE_METRICS_USE_PREFIX_FOR_SCOPE; }