@Override public <T> T record(Callable<T> f) throws Exception { return impl.recordCallable(f); }
@Test @DisplayName("callable task that throws exception is still recorded") default void recordCallableException(MeterRegistry registry) { Timer t = registry.timer("myTimer"); assertThrows(Exception.class, () -> { t.recordCallable(() -> { clock(registry).add(10, TimeUnit.NANOSECONDS); throw new Exception("uh oh"); }); }); clock(registry).add(step()); assertAll(() -> assertEquals(1L, t.count()), () -> assertEquals(10, t.totalTime(TimeUnit.NANOSECONDS), 1.0e-12)); }