I am using the Dropwizard Metrics library to record the times various actions take in my app, using a Timer
and the the ConsoleReporter
and that records count
, mean rate
, etc to the console fine.
I would like these figures to also be available on the /metrics servlet and based on http://metrics.dropwizard.io/3.1.0/manual/servlets/ I need to access the MetricRegistry called com.codahale.metrics.servlets.MetricsServlet.registry
. But looking at the docs and code, I can't see how that is done. My existing /metrics only outputs Timers for dropwizard and jetty classes
[EDIT]
private static final MetricRegistry metricRegistry = new MetricRegistry();
...
Timer timer = metricRegistry.timer(name("com.codahale.metrics.servlets.MetricsServlet.registry","testval"));
How do I connect my Timer to the output of /metrics?