micrometer
micrometer copied to clipboard
Avoid creating redundant NoopMeters
Please describe the feature request.
Currently, when the register method is called it invokes the registerMeterIfNecessary
and then getOrCreateMeter
. getOrCreateMeter applies the meter-filters and if any of the filters reply with a MeterFilterReply.DENY
then a NoopMeter is created and returned. For every MeterFilterReply.DENY
we go on creating a new NoopMeter which seems unnecessary. Instead, we should have DefaultInstances created for each of the NoopMeter and the same instance should be returned.
Rationale NoopMeter as the name suggests no-op and does nothing. So returning a default instance should be fine.