Hi Jean,

we've added a no-op metrics registry in Dropwizard Metrics 4.1.17 which you 
could set in your application's initialize method:
https://javadoc.io/doc/io.dropwizard.metrics/metrics-core/4.2.0-beta.1/com/codahale/metrics/NoopMetricRegistry.html
 
<https://javadoc.io/doc/io.dropwizard.metrics/metrics-core/4.2.0-beta.1/com/codahale/metrics/NoopMetricRegistry.html>

HTH,
Jochen

> Am 02.12.2020 um 11:09 schrieb Jean Michel <[email protected]>:
> 
> I understand metrics is an important and significant feature of dropwizard. 
> However, for a memory constrained application, I would like to be able to 
> disable metrics entirely. I haven't found a way to do so. For example 
> Bootstrap registerMetrics() adds a number of default metrics, and then starts 
> the JmxReporter for those ones. There seem to be other metrics registered in 
> various places as well, which may also contribute here.
> 
> Here are some examples (from an analyze using MAT) of what I would like to 
> reduce or get rid of entirely in this case:
> 
> Class Name                                          | Objects | Shallow Heap
> -----------------------------------------------------------------------------
> java.util.concurrent.ConcurrentSkipListMap$Node     |  +2 487 |      +59 688
> com.codahale.metrics.WeightedSnapshot$WeightedSample|  +2 487 |      +59 688
> java.lang.Double                                    |  +2 487 |      +39 792
> java.util.concurrent.ConcurrentSkipListMap$Index    |  +1 261 |      +30 264
> -----------------------------------------------------------------------------
> 
> 
> So is there a kosher way I can use to disable ALL metrics?
> 
> -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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dropwizard-user/6f4cda8f-bd20-4af1-9595-c8c67089d359n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dropwizard-user/6f4cda8f-bd20-4af1-9595-c8c67089d359n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/21472EF1-3B86-401E-BAF0-35F3CAFA084C%40schalanda.name.

Reply via email to