twang126 commented on code in PR #28513:
URL: https://github.com/apache/beam/pull/28513#discussion_r1340523153


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java:
##########
@@ -2027,6 +2034,10 @@ private void updateVMMetrics() {
   private void updateThreadMetrics() {
     timeAtMaxActiveThreads.getAndReset();
     timeAtMaxActiveThreads.addValue(workUnitExecutor.allThreadsActiveTime());
+    activeThreads.getAndReset();
+    activeThreads.addValue(workUnitExecutor.activeCount());
+    maxActiveThreads.getAndReset();
+    maxActiveThreads.addValue(chooseMaximumNumberOfThreads());

Review Comment:
   The counter name maxActiveThreads is misleading. Instead, I believe the 
intention is to measure the number of total allocated threads for the worker. 
We should probably rename the counter to something along the lines of 
totalAllocatedThreads.
   
   In this case (maybe I'm wrong here) but I think the counter type (intSum) 
and value (chooseMaximumNumberOfThreads()) are actually what we want? The end 
goal is to be able to calculate the ratio between the total # of active threads 
across all user workers / the total # of threads that are allocated. 
   



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