MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / aggregate

Method aggregate

src/core/SimpleHistogram.java:246–261  ·  view source on GitHub ↗
(Histogram histo, HistogramAggregation func)

Source from the content-addressed store, hash-verified

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) {

Calls 11

getBucketCountMethod · 0.95
addBucketMethod · 0.95
setOverflowMethod · 0.95
getOverflowMethod · 0.95
setUnderflowMethod · 0.95
getUnderflowMethod · 0.95
getLowerBoundMethod · 0.80
getUpperBoundMethod · 0.80
getHistogramMethod · 0.65
getKeyMethod · 0.45
getValueMethod · 0.45