private void reportTimer(String name, Timer timer) {
        final Snapshot snapshot = timer.getSnapshot();
        String prefixedName = prefix(name);
        if (!snapshots.hasDescriptor(prefixedName)) {

            MetricItem.Builder builder = MetricItem.Builder.create();
            builder.duration("max", durationUnit);
            builder.duration("mean", durationUnit);
            builder.duration("min", durationUnit);
            builder.duration("stddev", durationUnit);

            builder.duration("p50", durationUnit);
            builder.duration("p75", durationUnit);
            builder.duration("p95", durationUnit);
            builder.duration("p98", durationUnit);
            builder.duration("p99", durationUnit);
            builder.duration("p95", durationUnit);
            builder.duration("p999", durationUnit);

            builder.calls("calls");

            builder.calls("m1_rate", 1, rateUnit);
            builder.calls("m5_rate", 1, rateUnit);
            builder.calls("m15_rate", 1, rateUnit);
            builder.calls("mean_rate", rateUnit);

            snapshots.setDescriptor(prefixedName, builder.build());

        }

        Map<String, Number> values = new HashMap<>();

        values.put("max", convertDuration(snapshot.getMax()));
        values.put("mean", convertDuration(snapshot.getMean()));
        values.put("min", convertDuration(snapshot.getMin()));
        values.put("stddev", convertDuration(snapshot.getStdDev()));

        values.put("p50", convertDuration(snapshot.getMedian()));
        values.put("p75", convertDuration(snapshot.get75thPercentile()));
        values.put("p95", convertDuration(snapshot.get95thPercentile()));
        values.put("p98", convertDuration(snapshot.get98thPercentile()));
        values.put("p99", convertDuration(snapshot.get99thPercentile()));
        values.put("p999", convertDuration(snapshot.get999thPercentile()));

        addMetered(timer, values, "calls");

        snapshots.addSnapshot(prefixedName, getTimestamp(), values);

    }
private void reportTimer ( String name , Timer timer ) { final Snapshot snapshot = timer . getSnapshot ( ) ; String prefixedName = prefix ( name ) ; if ( ! snapshots . hasDescriptor ( prefixedName ) ) { MetricItem . Builder builder = MetricItem . Builder . create ( ) ; builder . duration ( "max" , durationUnit ) ; builder . duration ( "mean" , durationUnit ) ; builder . duration ( "min" , durationUnit ) ; builder . duration ( "stddev" , durationUnit ) ; builder . duration ( "p50" , durationUnit ) ; builder . duration ( "p75" , durationUnit ) ; builder . duration ( "p95" , durationUnit ) ; builder . duration ( "p98" , durationUnit ) ; builder . duration ( "p99" , durationUnit ) ; builder . duration ( "p95" , durationUnit ) ; builder . duration ( "p999" , durationUnit ) ; builder . calls ( "calls" ) ; builder . calls ( "m1_rate" , 1 , rateUnit ) ; builder . calls ( "m5_rate" , 1 , rateUnit ) ; builder . calls ( "m15_rate" , 1 , rateUnit ) ; builder . calls ( "mean_rate" , rateUnit ) ; snapshots . setDescriptor ( prefixedName , builder . build ( ) ) ; } Map < String , Number > values = new HashMap < > ( ) ; values . put ( "max" , convertDuration ( snapshot . getMax ( ) ) ) ; values . put ( "mean" , convertDuration ( snapshot . getMean ( ) ) ) ; values . put ( "min" , convertDuration ( snapshot . getMin ( ) ) ) ; values . put ( "stddev" , convertDuration ( snapshot . getStdDev ( ) ) ) ; values . put ( "p50" , convertDuration ( snapshot . getMedian ( ) ) ) ; values . put ( "p75" , convertDuration ( snapshot . get75thPercentile ( ) ) ) ; values . put ( "p95" , convertDuration ( snapshot . get95thPercentile ( ) ) ) ; values . put ( "p98" , convertDuration ( snapshot . get98thPercentile ( ) ) ) ; values . put ( "p99" , convertDuration ( snapshot . get99thPercentile ( ) ) ) ; values . put ( "p999" , convertDuration ( snapshot . get999thPercentile ( ) ) ) ; addMetered ( timer , values , "calls" ) ; snapshots . addSnapshot ( prefixedName , getTimestamp ( ) , values ) ; }
Report a timer using fields max/mean/min/stddev,p50/p75/p95/p98/p99/p999/calls/m1_rate/m5_rate/m15_rate/mean_rate

@param name
@param timer