    @Test
    public void testTimer() throws InterruptedException {

        Metrics.startSlf4jReporter(1, TimeUnit.SECONDS);
        Timer requests = Metrics.timer(name(MetricsTest.class, "request"));
        Random random = new Random();
        for (int i = 0; i < 5; i++) {
            Timer.Context context = requests.time();
            try {
                Thread.sleep(random.nextInt(1000));
            } catch (InterruptedException e) {
                e.printStackTrace();
            } finally {
                context.stop();
            }
            TimeUnit.SECONDS.sleep(1);
        }
    }