@Test public void testGetOrCreateHistogram() { try { MetricRegistryHolder holder = MetricRegistryHolder.getInstance(); assertEquals(holder.getOrCreateHistogram("Histogram"), holder.getOrCreateHistogram("Histogram")); } catch (Exception e) { fail("Exception should not have been thrown!"); } }
public Histogram getOrCreateHistogram(String metricName) { return metrics.histogram(metricName, this::createDefaultHistogram); }
MetricRegistryHolder { public Histogram getOrCreateHistogram(String metricName) { return metrics.histogram(metricName, this::createDefaultHistogram); } }
MetricRegistryHolder { public Histogram getOrCreateHistogram(String metricName) { return metrics.histogram(metricName, this::createDefaultHistogram); } private  MetricRegistryHolder(); }
MetricRegistryHolder { public Histogram getOrCreateHistogram(String metricName) { return metrics.histogram(metricName, this::createDefaultHistogram); } private  MetricRegistryHolder(); static MetricRegistryHolder getInstance(); MetricRegistry getMetrics(); void setMetrics(MetricRegistry metricRegistry); @SuppressWarnings("unchecked") SimpleSensor<T> getOrCreateSimpleSensor(String metricName); Histogram getOrCreateHistogram(String metricName); }
MetricRegistryHolder { public Histogram getOrCreateHistogram(String metricName) { return metrics.histogram(metricName, this::createDefaultHistogram); } private  MetricRegistryHolder(); static MetricRegistryHolder getInstance(); MetricRegistry getMetrics(); void setMetrics(MetricRegistry metricRegistry); @SuppressWarnings("unchecked") SimpleSensor<T> getOrCreateSimpleSensor(String metricName); Histogram getOrCreateHistogram(String metricName);  }