zentol commented on a change in pull request #8886: [FLINK-12987][metrics] fix
DescriptiveStatisticsHistogram#getCount() not returning the number of elements
seen
URL: https://github.com/apache/flink/pull/8886#discussion_r314321366
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/DescriptiveStatisticsHistogram.java
##########
@@ -22,25 +22,30 @@
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
+import java.util.concurrent.atomic.AtomicLong;
+
/**
* The {@link DescriptiveStatisticsHistogram} use a DescriptiveStatistics
{@link DescriptiveStatistics} as a Flink {@link Histogram}.
*/
public class DescriptiveStatisticsHistogram implements
org.apache.flink.metrics.Histogram {
private final DescriptiveStatistics descriptiveStatistics;
+ private final AtomicLong elementsSeen = new AtomicLong();
Review comment:
I would not try to handle concurrent write access btw. (users are
responsible for ensuring single-threaded writes)
----------------------------------------------------------------
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]
With regards,
Apache Git Services