/** * Create a reservoir with a default recorder. This recorder should be suitable for most usage. */ public HdrHistogramResetOnSnapshotReservoir() { this(new Recorder(2)); }
private void initializeRecorder() { if (_recorder == null) { _recorder = new Recorder(LOWEST_DISCERNIBLE_VALUE, HIGHEST_TRACKABLE_VALUE, NUMBER_OF_FIGNIFICANT_VALUE_DIGITS); } }
/** * Create a reservoir with a default recorder. This recorder should be suitable for most usage. */ public HdrHistogramReservoir() { this(new Recorder(2)); }
private void initializeRecorder() { if (_recorder == null) { _recorder = new Recorder(LOWEST_DISCERNIBLE_VALUE, HIGHEST_TRACKABLE_VALUE, NUMBER_OF_FIGNIFICANT_VALUE_DIGITS); } }
public OneMeasurementHdrHistogram(String name, Properties props) { super(name); percentiles = getPercentileValues(props.getProperty(PERCENTILES_PROPERTY, PERCENTILES_PROPERTY_DEFAULT)); verbose = Boolean.valueOf(props.getProperty(VERBOSE_PROPERTY, String.valueOf(false))); boolean shouldLog = Boolean.parseBoolean(props.getProperty("hdrhistogram.fileoutput", "false")); if (!shouldLog) { log = null; histogramLogWriter = null; } else { try { final String hdrOutputFilename = props.getProperty("hdrhistogram.output.path", "") + name + ".hdr"; log = new PrintStream(new FileOutputStream(hdrOutputFilename), false); } catch (FileNotFoundException e) { throw new RuntimeException("Failed to open hdr histogram output file", e); } histogramLogWriter = new HistogramLogWriter(log); histogramLogWriter.outputComment("[Logging for: " + name + "]"); histogramLogWriter.outputLogFormatVersion(); long now = System.currentTimeMillis(); histogramLogWriter.outputStartTime(now); histogramLogWriter.setBaseTime(now); histogramLogWriter.outputLegend(); } histogram = new Recorder(3); }
private Recorder getRecorder(Host host, Statement statement, Exception exception) { Object key = computeKey(host, statement, exception); if (key == null) return null; Recorder recorder = recorders.get(key); if (recorder == null) { recorder = new Recorder(highestTrackableLatencyMillis, numberOfSignificantValueDigits); Recorder old = recorders.putIfAbsent(key, recorder); if (old != null) { // We got beaten at creating the recorder, use the actual instance and discard ours recorder = old; } else { // Also set an empty cache entry to remember the time we started recording: cachedHistograms.putIfAbsent(key, CachedHistogram.empty()); } } return recorder; }
public Recorder startTracker(Duration interval) { final Recorder histogram = new Recorder(3600000000000L, 3); Flux.interval(interval) .doOnNext( aLong -> { System.out.println("---- PING/ PONG HISTO ----"); histogram .getIntervalHistogram() .outputPercentileDistribution(System.out, 5, 1000.0, false); System.out.println("---- PING/ PONG HISTO ----"); }) .subscribe(); return histogram; }
/** * Create a reservoir with a default recorder. This recorder should be suitable for most usage. */ public HdrHistogramResetOnSnapshotReservoir() { this(new Recorder(2)); }
/** * Create a reservoir with a default recorder. This recorder should be suitable for most usage. */ public HdrHistogramResetOnSnapshotReservoir() { this(new Recorder(2)); }
private void initializeRecorder() { if (_recorder == null) { _recorder = new Recorder(LOWEST_DISCERNIBLE_VALUE, HIGHEST_TRACKABLE_VALUE, NUMBER_OF_FIGNIFICANT_VALUE_DIGITS); } }
/** * Create a reservoir with a default recorder. This recorder should be suitable for most usage. */ public HdrHistogramReservoir() { this(new Recorder(2)); }
/** * Create a reservoir with a default recorder. This recorder should be suitable for most usage. */ public HdrHistogramReservoir() { this(new Recorder(2)); }
private void initializeRecorder() { if (_recorder == null) { _recorder = new Recorder(LOWEST_DISCERNIBLE_VALUE, HIGHEST_TRACKABLE_VALUE, NUMBER_OF_FIGNIFICANT_VALUE_DIGITS); } }
private static Supplier<Recorder> twoSignificantDigits() { return () -> new Recorder(2); }
private Recorder buildRecorder() { if (lowestDiscernibleValue.isPresent()) { return new Recorder(lowestDiscernibleValue.get(), highestTrackableValue.get(), numberOfSignificantValueDigits); } if (highestTrackableValue.isPresent()) { return new Recorder(highestTrackableValue.get(), numberOfSignificantValueDigits); } return new Recorder(numberOfSignificantValueDigits); }
private Recorder buildRecorder() { if (lowestDiscernibleValue.isPresent()) { return new Recorder(lowestDiscernibleValue.get(), highestTrackableValue.get(), numberOfSignificantValueDigits); } if (highestTrackableValue.isPresent()) { return new Recorder(highestTrackableValue.get(), numberOfSignificantValueDigits); } return new Recorder(numberOfSignificantValueDigits); }
/** * Creates a HDR histogram. * @param numberOfSignificantValueDigits The number of significant digits in the value. * @param reportTotalHistogram If {@code true}, the long-running histogram will be reported. Otherwise, the histogram * collected since the last snapshot was acquired will be reported. */ public HDRReservoir(final int numberOfSignificantValueDigits, final boolean reportTotalHistogram) { this.highestTrackableValue = Long.MAX_VALUE; this.recorder = new Recorder(numberOfSignificantValueDigits); this.totalHistogram = new Histogram(numberOfSignificantValueDigits); this.reportTotalHistogram = reportTotalHistogram; }
/** * Creates a HDR histogram. * @param highestTrackableValue The highest value tracked. Anything larger will be set to the maximum. * @param numberOfSignificantValueDigits The number of significant digits in the value. * @param reportTotalHistogram If {@code true}, the long-running histogram will be reported. Otherwise, the histogram * collected since the last snapshot was acquired will be reported. */ public HDRReservoir(final long highestTrackableValue, final int numberOfSignificantValueDigits, final boolean reportTotalHistogram) { this.highestTrackableValue = highestTrackableValue; this.recorder = new Recorder(highestTrackableValue, numberOfSignificantValueDigits); this.totalHistogram = new Histogram(highestTrackableValue, numberOfSignificantValueDigits); this.reportTotalHistogram = reportTotalHistogram; }
private Recorder getRecorder(Host host, Statement statement, Exception exception) { Object key = computeKey(host, statement, exception); if (key == null) return null; Recorder recorder = recorders.get(key); if (recorder == null) { recorder = new Recorder(highestTrackableLatencyMillis, numberOfSignificantValueDigits); Recorder old = recorders.putIfAbsent(key, recorder); if (old != null) { // We got beaten at creating the recorder, use the actual instance and discard ours recorder = old; } else { // Also set an empty cache entry to remember the time we started recording: cachedHistograms.putIfAbsent(key, CachedHistogram.empty()); } } return recorder; }
public Recorder startTracker(Duration interval) { final Recorder histogram = new Recorder(3600000000000L, 3); Flux.interval(interval) .doOnNext(aLong -> { System.out.println("---- PING/ PONG HISTO ----"); histogram.getIntervalHistogram() .outputPercentileDistribution(System.out, 5, 1000.0, false); System.out.println("---- PING/ PONG HISTO ----"); }) .subscribe(); return histogram; }