micrometer
micrometer copied to clipboard
Improve performance of meter interaction
Fixes https://github.com/micrometer-metrics/micrometer/issues/4856,
This PR introduces the following changes,
- No-op's adding meterfilters after the meters are registered to the registry. We can argue this could break people who add meter filters. But doing so would invalidate the entire meter registry which is an error state. Currently, if someone does this meter registry is in an inconsistent state where part of meters are mapped with only a subset of meter filters.
- Keeps a map to do the look-up between
Id
without meter filters to the actual meter. When create is called on a meter, we first check if a mapping exist and immediately returns the actual meter.
TODO:
- [ ] Add additional tests to MeterRegistryTest