JayajP commented on code in PR #29808:
URL: https://github.com/apache/beam/pull/29808#discussion_r1437852224
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/util/HistogramData.java:
##########
@@ -231,6 +239,38 @@ private synchronized void updateStatistics(double value) {
sumOfSquaredDeviations += (value - mean) * (value - oldMean);
}
+ /**
+ * Increment the {@code numTopRecords} and update {@code topRecordsMean}
when a new overflow value
+ * is recorded. This function should only be called when a Histogram is
recording a value greater
+ * than the upper bound of it's largest bucket.
+ *
+ * @param value
+ */
+ private synchronized void recordTopRecordsValue(double value) {
+ numTopRecords++;
+ if (numTopRecords == 1) {
+ topRecordsMean = value;
+ } else {
+ topRecordsMean = topRecordsMean + (value - topRecordsMean) /
numTopRecords;
Review Comment:
Done.
--
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]