Micrometer extends OpenMonBase<TimerContext> { @Override public void stop(TimerContext context) { long executionTimeMs = context.stop(); getTimer(context.getJoinPoint().toString()).record(executionTimeMs, TimeUnit.MILLISECONDS); }  @Override TimerContext start(JoinPoint.StaticPart jp); @Override void stop(TimerContext context); static MeterRegistry getMeterRegistry(); static void setMeterRegistry(MeterRegistry newMeterRegistry);  }
@Test public void testStop() throws Exception { TimerContext mon = openMon.start(staticPart); sleep(250); openMon.stop(mon); assertThat(openMon.getTimer(staticPart.toString()).count()) .describedAs("The timer should have completed/been stopped").isEqualTo(1); assertThat(openMon.getTimer(staticPart.toString()).totalTime(TimeUnit.MILLISECONDS)) .describedAs("The timer should have expected time").isGreaterThanOrEqualTo(250); }