public void harvest(Consumer<AbstractHistogram> consumer) {
    AbstractHistogram current = claim(_current);
    _current.set(claim(_inactive)); //unblock other writers
    try {
      consumer.accept(current);
    } catch (Throwable t) {
      LOG.error("failed to consume histogram for latencies metric", t);
    } finally {
      current.reset();
      _inactive.set(current);
    }
  }
@Test
  public void testNoRecording()
  {
    LatencyMetric metric = new LatencyMetric();
    final AtomicLong totalCount = new AtomicLong();
    metric.harvest(h -> totalCount.set(h.getTotalCount()));
    assertEquals(totalCount.get(), 0L);
    metric.harvest(h -> totalCount.set(h.getTotalCount()));
    assertEquals(totalCount.get(), 0L);
  }