@Override public Object getValueAndReset() { Histogram copy = _histo.copy(); _histo.reset(); return copy; } }
/** * @return a copy of the accumulated state since the reservoir last had a snapshot */ @Nonnull private synchronized Histogram getDataSinceLastSnapshotAndReset() { intervalHistogram = recorder.getIntervalHistogram(intervalHistogram); return intervalHistogram.copy(); } }
/** * @return a copy of the accumulated state since the reservoir was created */ @Nonnull private synchronized Histogram updateRunningTotals() { intervalHistogram = recorder.getIntervalHistogram(intervalHistogram); runningTotals.add(intervalHistogram); return runningTotals.copy(); } }
((Histogram) intervalHistogram).copy(); accumulatedRegularHistogram.reset(); accumulatedRegularHistogram.setAutoResize(true);
private Histogram makeSnapshot() { synchronized (histogram) { return histogram.copy(); } }
private Histogram makeSnapshot() { synchronized (histogram) { return histogram.copy(); } }
public Map<String,Histogram> metrics() { return metrics.entrySet() .stream() .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().copy())); }
public Map<String,Histogram> metrics (String prefix) { return metrics.entrySet() .stream() .filter(e -> e.getKey().startsWith(prefix)) .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().copy())); }
Phase(Supplier<Recorder> recorderSupplier, long proposedInvalidationTimestamp) { this.recorder = recorderSupplier.get(); this.intervalHistogram = recorder.getIntervalHistogram(); this.totalsHistogram = intervalHistogram.copy(); this.proposedInvalidationTimestamp = proposedInvalidationTimestamp; }
/** * @return a copy of the accumulated state since the reservoir last had a snapshot */ @Nonnull private synchronized Histogram getDataSinceLastSnapshotAndReset() { intervalHistogram = recorder.getIntervalHistogram(intervalHistogram); return intervalHistogram.copy(); } }
private synchronized Histogram updateRunningTotals() { stats.addIntervalHistogramTo(runningTotals); return runningTotals.copy(); } }
/** * @return a copy of the accumulated state since the reservoir last had a snapshot */ @Nonnull private synchronized Histogram getDataSinceLastSnapshotAndReset() { intervalHistogram = recorder.getIntervalHistogram(intervalHistogram); return intervalHistogram.copy(); } }
Phase(Supplier<Recorder> recorderSupplier, long proposedInvalidationTimestamp) { this.recorder = recorderSupplier.get(); this.intervalHistogram = recorder.getIntervalHistogram(); this.totalsHistogram = intervalHistogram.copy(); this.proposedInvalidationTimestamp = proposedInvalidationTimestamp; }
public synchronized Histogram copy() { return getAggregateHistogram().copy(); }
public synchronized Histogram copy() { return getAggregateHistogram().copy(); }
public void dump (PrintStream ps, String indent) { metrics.entrySet() .stream() .sorted(Map.Entry.comparingByKey()) .forEach(e -> dumpPercentiles (ps, indent, e.getKey(), e.getValue().copy())); }
public void dumpHistograms (File dir, String prefix) { metrics.entrySet() .stream() .sorted(Map.Entry.comparingByKey()) .forEach(e -> dumpHistogram (dir, prefix + e.getKey(), e.getValue().copy())); } }
/** * @return a copy of the accumulated state since the reservoir was created */ @Nonnull private synchronized Histogram updateRunningTotals() { intervalHistogram = recorder.getIntervalHistogram(intervalHistogram); runningTotals.add(intervalHistogram); return runningTotals.copy(); } }
/** * @return a copy of the accumulated state since the reservoir was created */ @Nonnull private synchronized Histogram updateRunningTotals() { intervalHistogram = recorder.getIntervalHistogram(intervalHistogram); runningTotals.add(intervalHistogram); return runningTotals.copy(); } }
@Override public synchronized Snapshot getSnapshot() { lastSnapshotHistogram = recorder.getIntervalHistogram(lastSnapshotHistogram); totalHistogram.add(lastSnapshotHistogram); HDRSnapshot snapshot = new HDRSnapshot(totalHistogram.copy(), lastSnapshotHistogram.copy()); return reportTotalHistogram ? snapshot.totalSnapshot() : snapshot.sinceLastSnapshot(); }