@Test
public void reportsTimerValues() throws Exception {

    final Timer timer = mock(Timer.class);
    when(timer.getCount()).thenReturn(1L);
    when(timer.getMeanRate()).thenReturn(2.0);
    when(timer.getOneMinuteRate()).thenReturn(3.0);
    when(timer.getFiveMinuteRate()).thenReturn(4.0);
    when(timer.getFifteenMinuteRate()).thenReturn(5.0);
    final Snapshot snapshot = mock(Snapshot.class);
    when(snapshot.getMax()).thenReturn(TimeUnit.MILLISECONDS.toNanos(100));
    when(snapshot.getMean()).thenReturn((double) TimeUnit.MILLISECONDS.toNanos(200));
    when(snapshot.getMin()).thenReturn(TimeUnit.MILLISECONDS.toNanos(300));
    when(snapshot.getStdDev()).thenReturn((double) TimeUnit.MILLISECONDS.toNanos(400));
    when(snapshot.getMedian()).thenReturn((double) TimeUnit.MILLISECONDS.toNanos(500));
    when(snapshot.get75thPercentile()).thenReturn((double) TimeUnit.MILLISECONDS.toNanos(600));
    when(snapshot.get95thPercentile()).thenReturn((double) TimeUnit.MILLISECONDS.toNanos(700));
    when(snapshot.get98thPercentile()).thenReturn((double) TimeUnit.MILLISECONDS.toNanos(800));
    when(snapshot.get99thPercentile()).thenReturn((double) TimeUnit.MILLISECONDS.toNanos(900));
    when(snapshot.get999thPercentile()).thenReturn((double) TimeUnit.MILLISECONDS
            .toNanos(1000));
    when(timer.getSnapshot()).thenReturn(snapshot);
    reporter.report(map(),
            map(),
            map(),
            map(),
            map("test.another.timer", timer));
    assertThat(consoleOutput())
            .isEqualTo(lines(
                    dateHeader,
                    "",
                    "-- Timers ----------------------------------------------------------------------",
                    "test.another.timer",
                    "             count = 1",
                    "         mean rate = 2.00 calls/second",
                    "     1-minute rate = 3.00 calls/second",
                    "     5-minute rate = 4.00 calls/second",
                    "    15-minute rate = 5.00 calls/second",
                    "               min = 300.00 milliseconds",
                    "               max = 100.00 milliseconds",
                    "              mean = 200.00 milliseconds",
                    "            stddev = 400.00 milliseconds",
                    "            median = 500.00 milliseconds",
                    "              75% <= 600.00 milliseconds",
                    "              95% <= 700.00 milliseconds",
                    "              98% <= 800.00 milliseconds",
                    "              99% <= 900.00 milliseconds",
                    "            99.9% <= 1000.00 milliseconds",
                    "",
                    ""
            ));
}