arunpandianp commented on code in PR #41766:
URL: https://github.com/apache/beam/pull/41766#discussion_r4762796991


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/DataflowOutputCounter.java:
##########
@@ -104,16 +104,23 @@ private void updateEmptyWindows(WindowedValue<?> elem) {
           // Fan out for windows.
           totalElementCount += (elementWindowsSize == 0 ? 1L : 
elementWindowsSize);
         }
-        elementCount.addValue(totalElementCount);
+        if (totalElementCount > 0) {
+          // Weight meanByteCount by totalElementCount so MeanByteCount stays 
per-element rather
+          // than per-WorkItem (matching elementCount). Skip timer-only 
WorkItems.
+          objectAndByteCounter.update(elem, totalElementCount);

Review Comment:
   What is the desired behavior when there are multiple windows? 
   
   IIUC, including elementWindowsSize in totalElementCount here will under 
count per element bytes. 
   
   could you add tests with elements with multiple windows?
   
   



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