public RollingHistogram(Clock clock, StatisticConfig statisticConfig) { this.clock = clock; this.statisticConfig = statisticConfig; int ageBuckets = (int) statisticConfig.getBuckets(); ringBuffer = new DoubleRecorder[ageBuckets]; for (int i = 0; i < ageBuckets; i++) { ringBuffer[i] = new DoubleRecorder(statisticConfig.getPercentilePrecision()); } this.currentBucket = 0; this.lastRotateTimestampMillis = clock.getCurrentTime(); this.durationBetweenRotatesMillis = statisticConfig.getTimeWindow().toMillis() / ageBuckets; intervalHistogram = new DoubleHistogram(statisticConfig.getPercentilePrecision()); accumulatedHistogram = new DoubleHistogram(statisticConfig.getPercentilePrecision()); }
accumulatedHistogram = new DoubleHistogram(statisticConfig.getPercentilePrecision());