| 244 | } |
| 245 | |
| 246 | public void aggregate(Histogram histo, HistogramAggregation func) { |
| 247 | if (func == HistogramAggregation.SUM) { |
| 248 | SimpleHistogram y1Histo = (SimpleHistogram) histo; |
| 249 | for (Map.Entry<HistogramBucket, Long> bucket : |
| 250 | (Set<Map.Entry<HistogramBucket, Long>>) histo.getHistogram().entrySet()) { |
| 251 | Long newCount = this.getBucketCount(bucket.getKey().getLowerBound(), |
| 252 | bucket.getKey().getUpperBound()) + bucket.getValue(); |
| 253 | this.addBucket(bucket.getKey().getLowerBound(), |
| 254 | bucket.getKey().getUpperBound(), newCount); |
| 255 | } |
| 256 | this.setOverflow(y1Histo.getOverflow() + this.getOverflow()); |
| 257 | this.setUnderflow(y1Histo.getUnderflow() + this.getUnderflow()); |
| 258 | } else { |
| 259 | LOG.debug("Unsupported histogram aggregation used"); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | public void aggregate(List<Histogram> histos, HistogramAggregation func) { |
| 264 | if (func == HistogramAggregation.SUM) { |