public static Histogram getNewHistogram() { return new Histogram(NUMBER_SIGNIFICANT_DIGITS); } }
private static Histogram createHistogram() { return new Histogram(1, 10000000000L, 3); }
/** * Default Constructor. */ public Measurements() { histo = new Histogram(3600000000000L, 3); sysMs = 0; userMs = 0; gcMs = 0; memBytes = 0; uptimeSecs = 0; timeWindow = 0; acked = 0; failed = 0; topologyIds = new HashSet<>(); workers = 0; executors = 0; hosts = 0; congested = new HashMap<>(); skippedMaxSpoutMs = 0; uiCompleteLatency = 0.0; }
@Override public Histogram copy() { Histogram copy = new Histogram(this); copy.add(this); return copy; }
@Override public Histogram copyCorrectedForCoordinatedOmission(final long expectedIntervalBetweenValueSamples) { Histogram copy = new Histogram(this); copy.addWhileCorrectingForCoordinatedOmission(this, expectedIntervalBetweenValueSamples); return copy; }
/** * (From the Constructor of Histogram) * Construct a Histogram given the Lowest and Highest values to be tracked and a number of significant * decimal digits. Providing a lowestDiscernibleValue is useful is situations where the units used * for the histogram's values are much smaller that the minimal accuracy required. E.g. when tracking * time values stated in nanosecond units, where the minimal accuracy required is a microsecond, the * proper value for lowestDiscernibleValue would be 1000. * * @param lowestDiscernibleValue The lowest value that can be discerned (distinguished from 0) by the * histogram. Must be a positive integer that is {@literal >=} 1. May be * internally rounded down to nearest power of 2 * (if null 1 is used). * @param highestTrackableValue The highest value to be tracked by the histogram. Must be a positive * integer that is {@literal >=} (2 * lowestDiscernibleValue). * (if null 2 * lowestDiscernibleValue is used and auto-resize is enabled) * @param numberOfSignificantValueDigits Specifies the precision to use. This is the number of significant * decimal digits to which the histogram will maintain value resolution * and separation. Must be a non-negative integer between 0 and 5. */ public HistogramMetric(Long lowestDiscernibleValue, Long highestTrackableValue, final int numberOfSignificantValueDigits) { boolean autoResize = false; if (lowestDiscernibleValue == null) lowestDiscernibleValue = 1L; if (highestTrackableValue == null) { highestTrackableValue = 2 * lowestDiscernibleValue; autoResize = true; } _histo = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits); if (autoResize) _histo.setAutoResize(true); }
/** * Create a reservoir with a user-specified recorder. * * @param recorder Recorder to use */ public HdrHistogramReservoir(Recorder recorder) { this.recorder = recorder; /* * Start by flipping the recorder's interval histogram. * - it starts our counting at zero. Arguably this might be a bad thing if you wanted to feed in * a recorder that already had some measurements? But that seems crazy. * - intervalHistogram can be nonnull. * - it lets us figure out the number of significant digits to use in runningTotals. */ intervalHistogram = recorder.getIntervalHistogram(); runningTotals = new Histogram(intervalHistogram.getNumberOfSignificantValueDigits()); }
private void run() throws IOException final Histogram histogram = new Histogram(TimeUnit.SECONDS.toNanos(10), 3); final ByteBuffer buffer = ByteBuffer.allocateDirect(Configuration.MTU_LENGTH_DEFAULT);
final CountDownLatch LATCH = new CountDownLatch(threadCount); for (int i = 0; i < threadCount; i++) { final Histogram serviceTmHist = new Histogram(TimeUnit.SECONDS.toNanos(10), 3); final Histogram responseTmHist = new Histogram(TimeUnit.SECONDS.toNanos(10), 3); serviceTmHistograms.add(serviceTmHist); responseTmHistograms.add(responseTmHist);
private static Histogram createResultHistogram(final List<Histogram> list, final long start, final long end) { final Histogram result = new Histogram(TimeUnit.SECONDS.toNanos(10), 3); result.setStartTimeStamp(start); result.setEndTimeStamp(end); for (final Histogram hist : list) { result.add(hist); } return result; }
prevFailed = failed; Histogram copy = new Histogram(3600000000000L, 3);; synchronized (histo) { copy.add(histo);
@EnsuresNonNull("histogram") private void convertValuesToHistogram() { // tracking nanoseconds, but only at microsecond precision (to save histogram space) histogram = new Histogram(1000, 2000, HISTOGRAM_SIGNIFICANT_DIGITS); histogram.setAutoResize(true); for (int i = 0; i < size; i++) { histogram.recordValue(values[i]); } values = new long[0]; }
@Override protected AbstractHistogram newResource() { return new Histogram(StripedHistogram.this.highestTrackableValue, StripedHistogram.this.numberOfSignificantValueDigits); } };
private Histogram getHistogram (String p) { Histogram h = metrics.get(p); if (h == null) { Histogram hist = new Histogram(template); hist.setTag(p); metrics.putIfAbsent(p, hist); h = metrics.get(p); } return h; }
@Override public Histogram copy() { Histogram copy = new Histogram(this); copy.add(this); return copy; }
public IntervalBucket(Histogram aggregateHistogram, long lowestDiscernibleValue, long highestTrackableValue, int numberOfSignificantDigits, Boolean autoResize) { this.aggregateHistogram = aggregateHistogram; this.intervalHistogram = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantDigits); if (autoResize) { this.intervalHistogram.setAutoResize(true); } this.state = IntervalState.EMPTY; }
public IntervalBucket(Histogram aggregateHistogram, long lowestDiscernibleValue, long highestTrackableValue, int numberOfSignificantDigits, Boolean autoResize) { this.aggregateHistogram = aggregateHistogram; this.intervalHistogram = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantDigits); if (autoResize) { this.intervalHistogram.setAutoResize(true); } this.state = IntervalState.EMPTY; }
public LatencyStatsReservoir(LatencyStats stats) { this.stats = stats; intervalHistogram = stats.getIntervalHistogram(); runningTotals = new Histogram(intervalHistogram.getNumberOfSignificantValueDigits()); }