@Test public void testDiscardsBuckets() throws Exception { SparseTimeStat distribution = new SparseTimeStat(); distribution.add(100, MILLISECONDS); distribution.setBucketIdProvider(bucketIdProvider); distribution.add(1, MILLISECONDS); assertPreviousDistributionEmpty(distribution); ++bucketIdProvider.id; distribution.add(2, MILLISECONDS); distribution.add(3, MILLISECONDS); assertPreviousDistribution(distribution, 1, .001, .001, .001); ++bucketIdProvider.id; ++bucketIdProvider.id; distribution.add(0.1, SECONDS); assertPreviousDistributionEmpty(distribution); ++bucketIdProvider.id; assertPreviousDistribution(distribution, 1, .1, .1, .1); distribution.add(0.2, SECONDS); ++bucketIdProvider.id; ++bucketIdProvider.id; assertPreviousDistributionEmpty(distribution); }
public void add(long value, TimeUnit timeUnit) { add(timeUnit.toNanos(value)); }
SparseTimeStat extends Bucketed<SparseTimeStat.Distribution> { public void add(long value, TimeUnit timeUnit) { add(timeUnit.toNanos(value)); } }
SparseTimeStat extends Bucketed<SparseTimeStat.Distribution> { public void add(long value, TimeUnit timeUnit) { add(timeUnit.toNanos(value)); } SparseTimeStat();  SparseTimeStat(Ticker ticker); }
SparseTimeStat extends Bucketed<SparseTimeStat.Distribution> { public void add(long value, TimeUnit timeUnit) { add(timeUnit.toNanos(value)); } SparseTimeStat();  SparseTimeStat(Ticker ticker); void add(long value, TimeUnit timeUnit); void add(double value, TimeUnit timeUnit); void add(Duration duration); T time(Callable<T> callable); BlockTimer time(); }
SparseTimeStat extends Bucketed<SparseTimeStat.Distribution> { public void add(long value, TimeUnit timeUnit) { add(timeUnit.toNanos(value)); } SparseTimeStat();  SparseTimeStat(Ticker ticker); void add(long value, TimeUnit timeUnit); void add(double value, TimeUnit timeUnit); void add(Duration duration); T time(Callable<T> callable); BlockTimer time();  }