public Result done() { Result result = new Result(); result.type = typeName; result.direction = direction.name(); result.total = total; result.max = histogram.getMaxValue(); result.min = histogram.getMinValue(); result.mean = histogram.getMean(); result.p50 = histogram.getValueAtPercentile(50); result.p75 = histogram.getValueAtPercentile(75); result.p90 = histogram.getValueAtPercentile(90); result.p95 = histogram.getValueAtPercentile(95); result.p99 = histogram.getValueAtPercentile(99); result.p999 = histogram.getValueAtPercentile(99.9); this.histogram.reset(); this.histogram = null; return result; } }
private synchronized void updateHistograms() { try { recordingPhaser.readerLock(); inactiveRawDataHistogram.reset(); inactivePauseCorrectionsHistogram.reset(); swapHistograms(); long now = System.currentTimeMillis(); activeRecordingHistogram.setStartTimeStamp(now); activePauseCorrectionsHistogram.setStartTimeStamp(now); inactiveRawDataHistogram.setEndTimeStamp(now); inactivePauseCorrectionsHistogram.setEndTimeStamp(now); // Make sure we are not in the middle of recording a value on the previously current recording histogram: // Flip phase on epochs to make sure no in-flight recordings are active on pre-flip phase: recordingPhaser.flipPhase(); } finally { recordingPhaser.readerUnlock(); } }
private synchronized void updateHistograms() { try { recordingPhaser.readerLock(); inactiveRawDataHistogram.reset(); inactivePauseCorrectionsHistogram.reset(); swapHistograms(); long now = System.currentTimeMillis(); activeRecordingHistogram.setStartTimeStamp(now); activePauseCorrectionsHistogram.setStartTimeStamp(now); inactiveRawDataHistogram.setEndTimeStamp(now); inactivePauseCorrectionsHistogram.setEndTimeStamp(now); // Make sure we are not in the middle of recording a value on the previously current recording histogram: // Flip phase on epochs to make sure no in-flight recordings are active on pre-flip phase: recordingPhaser.flipPhase(); } finally { recordingPhaser.readerUnlock(); } }