li4wang commented on code in PR #2279:
URL: https://github.com/apache/zookeeper/pull/2279#discussion_r2298937582
##########
zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/main/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProvider.java:
##########
@@ -714,14 +714,21 @@ public Thread newThread(final Runnable runnable) {
}
}
+ private static class PrometheusRejectedExecutionHandler implements
RejectedExecutionHandler {
+ private static boolean maxQueueSizeExceeded = false;
+
+ @Override
+ public void rejectedExecution(final Runnable r, final
ThreadPoolExecutor e) {
+ if (!maxQueueSizeExceeded) {
+ maxQueueSizeExceeded = true;
+ LOG.warn("Prometheus metrics queue size exceeded the max");
Review Comment:
- Enhanced `RateLogger ` reduce string concatenation overhead.
- Added the rate logger back to visibility when exceeding max happens
--
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]