@Test
public void reportsTasksInformation() throws Exception {

    final Meter submitted = registry.meter("xs.submitted");
    final Counter running = registry.counter("xs.running");
    final Meter completed = registry.meter("xs.completed");
    final Timer duration = registry.timer("xs.duration");
    assertThat(submitted.getCount()).isEqualTo(0);
    assertThat(running.getCount()).isEqualTo(0);
    assertThat(completed.getCount()).isEqualTo(0);
    assertThat(duration.getCount()).isEqualTo(0);
    Future<?> theFuture = instrumentedExecutorService.submit(new Runnable() {
        public void run() {
            assertThat(submitted.getCount()).isEqualTo(1);
            assertThat(running.getCount()).isEqualTo(1);
            assertThat(completed.getCount()).isEqualTo(0);
            assertThat(duration.getCount()).isEqualTo(0);
        }
    });
    theFuture.get();
    assertThat(submitted.getCount()).isEqualTo(1);
    assertThat(running.getCount()).isEqualTo(0);
    assertThat(completed.getCount()).isEqualTo(1);
    assertThat(duration.getCount()).isEqualTo(1);
    assertThat(duration.getSnapshot().size()).isEqualTo(1);
}