ConstantMeasurable measurable = new ConstantMeasurable();
metrics.addMetric("direct.measurable", measurable);
Sensor s = metrics.sensor("test.sensor");
s.add("test.avg", new Avg());
s.add("test.max", new Max());
s.add("test.min", new Min());
s.add("test.rate", new Rate(TimeUnit.SECONDS));
s.add("test.occurences", new Rate(TimeUnit.SECONDS, new Count()));
s.add("test.count", new Count());
s.add(new Percentiles(100, -100, 100, BucketSizing.CONSTANT, new Percentile("test.median", 50.0), new Percentile("test.perc99_9",
99.9)));