aho135 commented on code in PR #19627:
URL: https://github.com/apache/druid/pull/19627#discussion_r3855834874


##########
processing/src/main/java/org/apache/druid/query/groupby/GroupByStatsProvider.java:
##########
@@ -224,9 +263,26 @@ public void mergeBufferAcquisitionTime(long delay)
       mergeBufferAcquisitionTimeNs.addAndGet(delay);
     }
 
-    public void maxMergeBufferUsedBytes(long bytes)
+    /**
+     * Accumulates the peak merge-buffer usage of one grouper (slice). Despite 
the previous "max" naming, this method
+     * sums across the slices a query holds; see {@link #mergeBufferUsedBytes}.
+     */
+    public void addMergeBufferUsedBytes(long bytes)
     {
-      maxMergeBufferUsedBytes.addAndGet(bytes);
+      mergeBufferUsedBytes.addAndGet(bytes);
+    }
+
+    /**
+     * Records one slice's peak fill ratio (1.0 iff it spilled), kept as a max 
across the query's slices; see
+     * {@link #maxSpillProximity}. Clamped to [0, 1]; NaN is ignored so a 
never-initialized grouper contributes nothing.
+     */
+    public void sliceUsage(double proximity)
+    {
+      if (Double.isNaN(proximity)) {
+        return;
+      }
+      final double clamped = proximity < 0.0 ? 0.0 : (proximity > 1.0 ? 1.0 : 
proximity);

Review Comment:
   Done in d1d2455.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to