Prevent invalid numbers in the chart
@@ -69,7 +69,7 @@ public class HistogramChart {
long totalCount = LongStream.of(h.counts).sum();
if (totalCount == 0) {
percents.add(new double[0]);
- }
+ } else {
double[] percents = new double[buckets];
long accCount = 0;
@@ -93,6 +93,7 @@ public class HistogramChart {
this.percents.add(percents);
}
}
+ }
private static long findMaxRange(Histogram h, double percentile) {
long threshold = (long) Math.ceil(percentile * LongStream.of(h.counts).sum());
