ProbeInstance getProbeInstance() { ProbeInstance probeInstance = this.probeInstance; if (probeInstance == null) { probeInstance = metricsRegistry.getProbeInstance(name); this.probeInstance = probeInstance; } return probeInstance; }
@Before public void setup() { metricsRegistry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), ProbeLevel.INFO); for (String name : metricsRegistry.getNames()) { ProbeInstance probeInstance = metricsRegistry.getProbeInstance(name); if (probeInstance != null && probeInstance.source != null) { metricsRegistry.deregister(probeInstance.source); } } }