@Test public void testMetricsContextJMXPrefixPropagation() throws Exception { Map<String, Object> props = new HashMap<>(); props.put(RestConfig.METRICS_JMX_PREFIX_CONFIG, "FooApp"); TestRestConfig config = new TestRestConfig(props); RestMetricsContext context = config.getMetricsContext(); assertEquals(context.getLabel(NAMESPACE), "FooApp"); }
public String getLabel(String label) { return contextLabels.get(label); }
RestMetricsContext implements MetricsContext { public String getLabel(String label) { return contextLabels.get(label); } }
RestMetricsContext implements MetricsContext { public String getLabel(String label) { return contextLabels.get(label); } RestMetricsContext(String namespace,
                            Map<String, Object> config); }
RestMetricsContext implements MetricsContext { public String getLabel(String label) { return contextLabels.get(label); } RestMetricsContext(String namespace,
                            Map<String, Object> config); void setLabel(String labelKey, String labelValue); void setLabels(Map<String, String> labels); String getLabel(String label); @Override Map<String, String> contextLabels(); }
RestMetricsContext implements MetricsContext { public String getLabel(String label) { return contextLabels.get(label); } RestMetricsContext(String namespace,
                            Map<String, Object> config); void setLabel(String labelKey, String labelValue); void setLabels(Map<String, String> labels); String getLabel(String label); @Override Map<String, String> contextLabels();  }