boyuanzz commented on a change in pull request #13924:
URL: https://github.com/apache/beam/pull/13924#discussion_r583363939



##########
File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PCollectionConsumerRegistry.java
##########
@@ -210,8 +233,8 @@ public void accept(WindowedValue<T> input) throws Exception 
{
       try (Closeable close =
           
MetricsEnvironment.scopedMetricsContainer(this.unboundMetricContainer)) {
         // Increment the counter for each window the element occurs in.
-        this.counter.inc(input.getWindows().size());
-
+        this.elementCountCounter.inc(input.getWindows().size());
+        this.sampledByteSizeDistribution.tryUpdate(input.getValue(), 
this.coder);

Review comment:
       It's not only a mean value but a distribution value(min, max, sum 
count), right? Can we put a TODO here to take care the case when we have 
multiple windows optimization some day? Besides, I was wrong in my comment. 
When considering multiple windows, the size should not be multiplied but the 
counter should be updated  per window with the same element size.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to