public class RecordingHistogram extends Histogram
Histogram class which not only samples and records data,
but also keeps track of the top 5 or 10 longest samples including the delay from the last reset.
Example output:
{ 50/90 99/99.9 99.99 - worst was: 500 / 900 1000 / 1000 1000 - 1000, top: [{ off: 10.0, dur: 1000.0 }, { off: 11.0, dur: 950.0 }, { off: 9.0, dur: 900.0 }, { off: 12.0, dur: 850.0 }, { off: 8.0, dur: 800.0 }] }
| Constructor and Description |
|---|
RecordingHistogram()
Constructs a new RecordingHistogram with specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected long |
currentTimeNanos()
Retrieves the current time in nanoseconds.
|
void |
reset()
Resets the state of this RecordingHistogram.
|
void |
sampleNanos(long durationNs)
Records a sample duration in nanoseconds and keeps track of the top durations.
|
@NotNull String |
toLongMicrosFormat(@NotNull DoubleFunction<Double> toMicros)
Formats the histogram to a long string with duration in microseconds.
|
@NotNull String |
toMicrosFormat(@NotNull DoubleFunction<Double> toMicros)
Formats the histogram to a string with duration in microseconds.
|
protected String |
was() |
add, equals, floor, fractionBits, getPercentiles, getPercentiles, hashCode, init, max, min, overRange, percentageLessThan, percentile, percentilesFor, powersOf2, sample, sampleCount, timeMicros, toLongMicrosFormat, toMicrosFormat, toString, totalCount, typicalpublic RecordingHistogram()
public void sampleNanos(long durationNs)
sampleNanos in interface NanoSamplersampleNanos in class HistogramdurationNs - The sample duration in nanoseconds.protected long currentTimeNanos()
@NotNull public @NotNull String toMicrosFormat(@NotNull @NotNull DoubleFunction<Double> toMicros)
toMicrosFormat in class HistogramtoMicros - A function to convert nanoseconds to microseconds.@NotNull public @NotNull String toLongMicrosFormat(@NotNull @NotNull DoubleFunction<Double> toMicros)
toLongMicrosFormat in class HistogramtoMicros - A function to convert nanoseconds to microseconds.public void reset()
Copyright © 2024. All rights reserved.