public void incrCompactionSeverity(double sev) { compactionSeverity.add(sev); }
public void incrManualSeverity(double sev) { manualSeverity.add(sev); }
@Override public void accept(ProgressEvent progressEvent) { Allocation allocation = progressEvent.getAllocation(); long progressUnits = progressEvent.getUnits(); double allocationFraction = allocation.getFractionOfRoot(); if (progressUnits != 0) { progress.add(progressUnits * allocationFraction); } if (completionTracker.updateProgress(allocation, progressUnits)) { // Note: Could produce false positives. updateNotifier.accept( new Update(progress.sum(), completionTracker.getUnfinishedAllocations())); } } }
@Override public void add(double value) { this.value.add(value); }
@Override public void increment() { count.add(1.0); }
@Override public void record(double amount) { if(amount >= 0) { count.increment(); this.amount.add(amount); } }
@Override public void set(double value) { synchronized (this) { this.value.reset(); this.value.add(value); } }
/** * Instantiates a new Local double accumulator. * * @param value the initial value of the accumulator * @param name the name of the accumulator */ public LocalMDoubleAccumulator(double value, String name) { super(name); this.value = new DoubleAdder(); this.value.add(value); }
private void updateHistogram(double value) { count.increment(); sum.add(value); for (RollingHistogram rollingHistogram : rollingHistograms) { rollingHistogram.record(value); } }
@Override public void increment(double amount) { synchronized (this) { value.add(amount); updateHistogram(value.sum()); } }
@Override public void setValue(double value) { synchronized (this) { this.value.reset(); this.value.add(value); updateHistogram(value); } }
@Override public void increment(double amount) { if (!shutdown && amount > 0) { count.add(amount); subscriber.onNext(lineBuilder.count((long) amount)); } }
@Override public void decrement(double amount) { synchronized (this) { value.add(-amount); updateHistogram(value.sum()); } }
@Override protected void recordNonNegative(double amount) { if (!shutdown && amount >= 0) { count.increment(); this.amount.add(amount); max.record(amount); subscriber.onNext(lineBuilder.histogram(amount)); } }
@Override protected void recordNonNegative(long amount, TimeUnit unit) { if (!shutdown && amount >= 0) { count.increment(); double msAmount = TimeUtils.convert(amount, unit, TimeUnit.MILLISECONDS); totalTime.add(msAmount); // not necessary to ship max, as most StatsD agents calculate this themselves max.getCurrent().add(Math.max(msAmount - max.getCurrent().doubleValue(), 0)); subscriber.onNext(lineBuilder.timing(msAmount)); } }
public void observe(double amt) { count.add(1); sum.add(amt); if (quantiles != null) { quantiles.observe(amt); } if (histogram != null) { histogram.observe(amt); } }
public void observe(double amt) { count.add(1); sum.add(amt); if (quantiles != null) { quantiles.observe(amt); } if (histogram != null) { histogram.observe(amt); } }
@Override public void accept(ProgressEvent progressEvent) { Allocation allocation = progressEvent.getAllocation(); long progressUnits = progressEvent.getUnits(); double allocationFraction = allocation.getFractionOfRoot(); if (progressUnits != 0) { progress.add(progressUnits * allocationFraction); } if (completionTracker.updateProgress(allocation, progressUnits)) { // Note: Could produce false positives. updateNotifier.accept( new Update(progress.sum(), completionTracker.getUnfinishedAllocations())); } } }
/** * Will calculate and return the dot product of this 1D-structure and another input 1D-vector. * * @param vector Another 1D-structure * @return The dot product */ default double dot(final Access1D<?> vector) { final DoubleAdder retVal = new DoubleAdder(); Structure1D.loopMatching(this, vector, i -> retVal.add(this.doubleValue(i) * vector.doubleValue(i))); return retVal.doubleValue(); }
/** * Will calculate and return the dot product of this 1D-structure and another input 1D-vector. * * @param vector Another 1D-structure * @return The dot product */ default double dot(final Access1D<?> vector) { final DoubleAdder retVal = new DoubleAdder(); Structure1D.loopMatching(this, vector, i -> retVal.add(this.doubleValue(i) * vector.doubleValue(i))); return retVal.doubleValue(); }