@Test public void testUpdate() throws Exception { MemoryMetricObserver mmo = new MemoryMetricObserver("mem", 50); AsyncMetricObserver amo = new AsyncMetricObserver("async", mmo, 50); amo.update(mkList(1)); amo.update(mkList(2)); amo.update(mkList(3)); amo.update(mkList(4)); Thread.sleep(1000); assertEquals(mmo.getObservations(), UnmodifiableList.of(mkList(1), mkList(2), mkList(3), mkList(4))); amo.stop(); }
public void stop() { stopUpdateThread = true; processingThread.interrupt(); }
AsyncMetricObserver extends BaseMetricObserver { public void stop() { stopUpdateThread = true; processingThread.interrupt(); } }
AsyncMetricObserver extends BaseMetricObserver { public void stop() { stopUpdateThread = true; processingThread.interrupt(); } AsyncMetricObserver(
      String name,
      MetricObserver observer,
      int queueSize,
      long expireTime);  AsyncMetricObserver(String name, MetricObserver observer);  AsyncMetricObserver(String name, MetricObserver observer, int queueSize); }
AsyncMetricObserver extends BaseMetricObserver { public void stop() { stopUpdateThread = true; processingThread.interrupt(); } AsyncMetricObserver(
      String name,
      MetricObserver observer,
      int queueSize,
      long expireTime);  AsyncMetricObserver(String name, MetricObserver observer);  AsyncMetricObserver(String name, MetricObserver observer, int queueSize); void updateImpl(List<Metric> metrics); void stop(); }
AsyncMetricObserver extends BaseMetricObserver { public void stop() { stopUpdateThread = true; processingThread.interrupt(); } AsyncMetricObserver(
      String name,
      MetricObserver observer,
      int queueSize,
      long expireTime);  AsyncMetricObserver(String name, MetricObserver observer);  AsyncMetricObserver(String name, MetricObserver observer, int queueSize); void updateImpl(List<Metric> metrics); void stop();  }