merlimat commented on code in PR #3546:
URL: https://github.com/apache/bookkeeper/pull/3546#discussion_r998815638


##########
bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedExecutor.java:
##########
@@ -434,43 +430,46 @@ protected OrderedExecutor(String baseName, int 
numThreads, ThreadFactory threadF
                 throw new RuntimeException("Couldn't start thread " + i, e);
             }
 
-            // Register gauges
-            statsLogger.scopeLabel("thread", String.valueOf(idx))
-                    .registerGauge(String.format("%s-queue", name), new 
Gauge<Number>() {
-                @Override
-                public Number getDefaultValue() {
-                    return 0;
-                }
-
-                @Override
-                public Number getSample() {
-                    return thread.getQueue().size();
-                }
-            });
-            statsLogger.scopeLabel("thread", String.valueOf(idx))
-                    .registerGauge(String.format("%s-completed-tasks", name), 
new Gauge<Number>() {
-                @Override
-                public Number getDefaultValue() {
-                    return 0;
-                }
-
-                @Override
-                public Number getSample() {
-                    return thread.getCompletedTaskCount();
-                }
-            });
-            statsLogger.scopeLabel("thread", String.valueOf(idx))
-                    .registerGauge(String.format("%s-total-tasks", name), new 
Gauge<Number>() {
-                @Override
-                public Number getDefaultValue() {
-                    return 0;
-                }
-
-                @Override
-                public Number getSample() {
-                    return thread.getTaskCount();
-                }
-            });
+            if (thread instanceof ThreadPoolExecutor) {

Review Comment:
   Good point. Also, I think there is an opportunity to add more stats around 
rejected & failed tasks. It would be very useful to see these in the charts.



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