devmadhuu commented on PR #7092: URL: https://github.com/apache/ozone/pull/7092#issuecomment-2301302352
> Can you please elaborate on why the alternative will perform better. > > ``` > because a prometheus sink already have a mechanism to publish metrics every 10 secs by default using call back with timer event. So we need to remove the above code to publish immediately. > ``` Thanks @kerneltime for review. So when we start the MetricsSystem, in `org.apache.hadoop.metrics2.impl.MetricsSystemImpl#start`, we also start a timer and while starting a timer, we also schedule a timerEvent which gets called every 10 secs default period. <img width="914" alt="image" src="https://github.com/user-attachments/assets/89db3ada-55fa-4492-b5fb-cb2e7e8e4bfd"> and as we can see in above screenshot of code, we are scheduling to call `onTimerEvent` every 10 secs which publishes the metrics already with `immediate` arg as `false`. So we need not to publish the metrics immediately as we are doing in `PrometheusServlet`. This puts too much load on queue. <img width="601" alt="image" src="https://github.com/user-attachments/assets/869d2897-6e1f-4b54-b0be-61cd0b983f78"> -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
