Thanks! That worked fine!
It took me a few minutes to figure out that the metrics-bom had to go
*before* the dropwizard-bom under dependencyManagement in order to take
effect, since entries in POM files generally aren't order sensitive. But
then I got the version override to work, and were able to use
the NoopMetricRegistry like this (in a subclass I already used to override
parts of ServerCommand):
@Override
protected void run(Bootstrap<Config> bootstrap, Namespace namespace, Config
configuration) throws Exception {
MetricsFactory mf = configuration.getMetricsFactory();
boolean disableMetrics = mf == null || mf.getReporters().isEmpty();
if (disableMetrics) // The NoopMetricRegistry removes/NOPs out all metrics
bootstrap.setMetricRegistry(new NoopMetricRegistry());
super.run(bootstrap, namespace, configuration);
}
-JM
--
You received this message because you are subscribed to the Google Groups
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dropwizard-user/43e9738c-b2a1-4d99-b59c-65c72f9dcd1en%40googlegroups.com.