@Test public void testTimeCallableException() throws Exception { SparseTimeStat stat = new SparseTimeStat(ticker); stat.setBucketIdProvider(bucketIdProvider); try { stat.time(() -> { ticker.elapseTime(10, TimeUnit.MILLISECONDS); throw new RuntimeException("test exception"); }); } catch (RuntimeException ignored) { } ++bucketIdProvider.id; assertPreviousDistribution(stat, 1, 0.010, 0.010, 0.010); }
public <T> T time(Callable<T> callable) throws Exception { try (BlockTimer ignored = time()) { return callable.call(); } }
SparseTimeStat extends Bucketed<SparseTimeStat.Distribution> { public <T> T time(Callable<T> callable) throws Exception { try (BlockTimer ignored = time()) { return callable.call(); } } }
SparseTimeStat extends Bucketed<SparseTimeStat.Distribution> { public <T> T time(Callable<T> callable) throws Exception { try (BlockTimer ignored = time()) { return callable.call(); } } SparseTimeStat();  SparseTimeStat(Ticker ticker); }
SparseTimeStat extends Bucketed<SparseTimeStat.Distribution> { public <T> T time(Callable<T> callable) throws Exception { try (BlockTimer ignored = time()) { return callable.call(); } } 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 <T> T time(Callable<T> callable) throws Exception { try (BlockTimer ignored = time()) { return callable.call(); } } 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();  }