micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

Improve performance of meter interaction

Open lenin-jaganathan opened this issue 11 months ago • 0 comments

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 betweenId 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

lenin-jaganathan avatar Mar 15 '24 19:03 lenin-jaganathan