Example #1
0
 ProbeInstance getProbeInstance() {
   ProbeInstance probeInstance = this.probeInstance;
   if (probeInstance == null) {
     probeInstance = metricsRegistry.getProbeInstance(name);
     this.probeInstance = probeInstance;
   }
   return probeInstance;
 }
Example #2
0
  @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);
      }
    }
  }