@Override public Histogram call(Histogram initialDistribution, Histogram distributionToAdd) { initialDistribution.add(distributionToAdd); return initialDistribution; } };
@Override public void add(final AbstractHistogram otherHistogram) { // Synchronize add(). Avoid deadlocks by synchronizing in order of construction identity count. if (identity < otherHistogram.identity) { synchronized (this) { synchronized (otherHistogram) { super.add(otherHistogram); } } } else { synchronized (otherHistogram) { synchronized (this) { super.add(otherHistogram); } } } }
private Histogram getIntervalHistogramAndAccumulate() { Histogram intervalHistogram = histogram.getIntervalHistogram(); // add this to the total time histogram. if (totalHistogram == null) { totalHistogram = intervalHistogram; } else { totalHistogram.add(intervalHistogram); } return intervalHistogram; }
/** * Add other to this. * @param other meaurements to add in. */ public void add(Measurements other) { histo.add(other.histo); sysMs += other.sysMs; userMs += other.userMs; gcMs += other.gcMs; memBytes = Math.max(memBytes, other.memBytes); acked += other.acked; failed += other.failed; uptimeSecs = Math.max(uptimeSecs, other.uptimeSecs); timeWindow += other.timeWindow; topologyIds.addAll(other.topologyIds); workers = Math.max(workers, other.workers); executors = Math.max(executors, other.executors); hosts = Math.max(hosts, other.hosts); congested.putAll(other.congested); skippedMaxSpoutMs += other.skippedMaxSpoutMs; uiCompleteLatency = Math.max(uiCompleteLatency, other.uiCompleteLatency); }
@Override public Histogram getCompletionHistogram() { completion.add(super.getFirstResponseHistogram()); return completion; } }
@Override public Histogram getFirstResponseHistogram() { firstResponse.add(super.getFirstResponseHistogram()); return firstResponse; }
@Override public Histogram copy() { Histogram copy = new Histogram(this); copy.add(this); return 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(); } }
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; }
copy.add(histo); histo.reset();
throw new IllegalStateException("Encountered a Histogram line in a log of DoubleHistograms."); accumulatedRegularHistogram.add((Histogram) intervalHistogram); ((DoubleHistogram) movingWindowSumHistogram).add((DoubleHistogram) intervalHistogram); } else { ((Histogram) movingWindowSumHistogram).add((Histogram) intervalHistogram);
public void merge(LazyHistogram toBeMergedHistogram) { if (toBeMergedHistogram.histogram == null) { for (int i = 0; i < toBeMergedHistogram.size; i++) { add(toBeMergedHistogram.values[i]); } } else { if (histogram == null) { convertValuesToHistogram(); } histogram.add(toBeMergedHistogram.histogram); } }
public void merge(Aggregate.Histogram toBeMergedHistogram) { ByteString encodedBytes = toBeMergedHistogram.getEncodedBytes(); if (encodedBytes.isEmpty()) { for (long rawValue : toBeMergedHistogram.getOrderedRawValueList()) { add(rawValue); } } else { if (histogram == null) { convertValuesToHistogram(); } histogram.add(Histogram.decodeFromByteBuffer(encodedBytes.asReadOnlyByteBuffer(), 0)); } }
@Override public Histogram call(Histogram initialDistribution, Histogram distributionToAdd) { initialDistribution.add(distributionToAdd); return initialDistribution; } };
public void add(Summary other) { statistics.add(other.statistics); successes += other.successes; failures += other.failures; exceptions += other.exceptions; timeouts += other.timeouts; fallbackSuccess += other.fallbackSuccess ; fallbackFailure += other.fallbackFailure ; shortCircuited += other.shortCircuited ; }
public void aggregate() { if (this.state == IntervalState.UPDATED) { aggregateHistogram.add(this.intervalHistogram); this.state = IntervalState.AGGREGATED; } } }
@Override public Histogram copy() { Histogram copy = new Histogram(this); copy.add(this); return copy; }
@Override public Histogram getFirstResponseHistogram() { firstResponse.add(super.getFirstResponseHistogram()); return firstResponse; }
/** * @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(); }