squakez commented on PR #28729:
URL: https://github.com/apache/camel/pull/28729#issuecomment-6599026660

   > The gauge lookup removed here is only one of several registry scans per 
exchange, so this PR alone barely changes the cost. Two more lookups in 
`MicrometerExchangeEventNotifier` are where the time goes:
   > 
   >     1. `getOrCreateTimer()` calls `find(name).tags(tags).timer()` on every 
sent and completed event. Each call copies and filters every registered meter. 
`Timer.builder(...).register(registry)` returns the same timer through a map 
lookup.
   > 
   >     2. `notify()` calls `CamelContext.getRoute(routeId)` on every event to 
check for kamelet/template routes. That call copies the route list under 
`routesLock`. `addInflightMeter()` already makes the same decision once per 
route, so the excluded route ids can be kept in a set.
   > 
   
   Thanks for the review. Mind that this PR only address the performance issues 
reported after the inclusion of the `last_timestamp` metric. Any other 
optimization should be properly analyzed creating a specific Jira issue and 
doing the related investigation. About the point 1 I think this is expected as 
it needs to find the metric if it existed, I did not go through an exhaustive 
analysis though, so, it makes sense to have a further look at it.
   
   I also suggest to do separate, per metric, analysis and to run any 
development as a TDD to prove the older implementation was performing worse 
than any new implementation.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to