public void recordValue(long val) { _histo.recordValue(val); }
/** * @deprecated */ @Override public synchronized void recordValue(final long value, final long expectedIntervalBetweenValueSamples) throws ArrayIndexOutOfBoundsException { super.recordValue(value, expectedIntervalBetweenValueSamples); }
@Override public synchronized void recordValue(final long value) throws ArrayIndexOutOfBoundsException { super.recordValue(value); }
@SuppressWarnings("unused") private static void pongHandler(final DirectBuffer buffer, final int offset, final int length, final Header header) { final long pingTimestamp = buffer.getLong(offset); final long rttNs = System.nanoTime() - pingTimestamp; HISTOGRAM.recordValue(rttNs); }
private static void pongHandler(final DirectBuffer buffer, final int offset, final int length, final Header header) { final long pingTimestamp = buffer.getLong(offset); final long rttNs = System.nanoTime() - pingTimestamp; HISTOGRAM.recordValue(rttNs); }
public int applyAsInt(final SelectionKey key) { try { buffer.clear(); receiveChannel.receive(buffer); final long receivedSequenceNumber = buffer.getLong(0); final long timestamp = buffer.getLong(SIZE_OF_LONG); if (receivedSequenceNumber != sequenceNumber) { throw new IllegalStateException("Data Loss:" + sequenceNumber + " to " + receivedSequenceNumber); } final long duration = System.nanoTime() - timestamp; HISTOGRAM.recordValue(duration); } catch (final IOException ex) { ex.printStackTrace(); } return 1; }
/** * Record a value * @param value the value to record * @throws ArrayIndexOutOfBoundsException (may throw) if value is exceeds highestTrackableValue */ @Override public void recordValue(final long value) throws ArrayIndexOutOfBoundsException { long criticalValueAtEnter = recordingPhaser.writerCriticalSectionEnter(); try { activeHistogram.recordValue(value); } finally { recordingPhaser.writerCriticalSectionExit(criticalValueAtEnter); } }
histogram.recordValue(duration);
@Override public void runTask(Engine engine, Task<?> t) throws InterruptedException { initArrivalProcess(); if (lastNano == 0) { lastNano = System.nanoTime(); } long nextNano = lastNano + arrivalProcess.nanosToNextEvent(); long actualNano = waitUntil(nextNano); planExecutionAccuracy.recordValue(Math.abs(actualNano - nextNano)); engine.run(t); lastNano = nextNano; }
histogram.recordValue(duration);
@Override public Histogram call(Histogram initialDistribution, HystrixCommandCompletion event) { if (event.didCommandExecute() && event.getTotalLatency() > -1) { initialDistribution.recordValue(event.getTotalLatency()); } return initialDistribution; } };
@Override public Histogram call(Histogram initialDistribution, HystrixCommandCompletion event) { if (event.didCommandExecute() && event.getExecutionLatency() > -1) { initialDistribution.recordValue(event.getExecutionLatency()); } return initialDistribution; } };
private void recordCompletionTimes(final Histogram planHistogram, Histogram taskHistogram, Task<?> task) { ShallowTrace st = task.getShallowTrace(); planHistogram.recordValue(st.getEndNanos() - st.getStartNanos()); task.getTrace().getTraceMap().values().forEach(shallowTrace -> { taskHistogram.recordValue(shallowTrace.getPendingNanos() - shallowTrace.getStartNanos()); }); }
histogram.recordValue(duration);
@Override public Histogram call(Histogram initialDistribution, HystrixCollapserEvent event) { switch (event.getEventType()) { case ADDED_TO_BATCH: if (event.getCount() > -1) { initialDistribution.recordValue(event.getCount()); } break; default: //do nothing break; } return initialDistribution; } };
private static void runLatencyTest(final int samples, final IPerfTestRunner logger, final Histogram serviceTmHist, final Histogram responseTmHist, final Pacer pacer) { for (int i = 0; i < samples; i++) { final long expectedStartTimeNanos = pacer.expectedNextOperationNanoTime(); pacer.acquire(1); final long actualStartTime = System.nanoTime(); logger.log(LATENCY_MSG); final long doneTime = System.nanoTime(); serviceTmHist.recordValue(doneTime - actualStartTime); responseTmHist.recordValue(doneTime - expectedStartTimeNanos); } }
@VisibleForTesting public void add(long value) { ensureCapacity(size + 1); if (histogram != null) { histogram.recordValue(value); } else { values[size++] = value; sorted = false; } }
@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]; }
@UserAggregationUpdate public void aggregate(@Name("value") Number value, @Name(value = "percentiles", defaultValue = "[0.5,0.75,0.9,0.95,0.99]") List<Double> percentiles) { if (value != null) { if (doubles!=null) { doubles.recordValue(value.doubleValue()); } else if (value instanceof Double || value instanceof Float) { this.doubles = HistogramUtil.toDoubleHistogram(values, 5); doubles.recordValue(value.doubleValue()); values = null; } else { values.recordValue(value.longValue()); } } this.percentiles = percentiles; }
@UserAggregationUpdate public void aggregate(@Name("value") Number value, @Name(value = "percentiles", defaultValue = "[0.5,0.75,0.9,0.95,0.99]") List<Double> percentiles) { if (value != null) { if (doubles!=null) { doubles.recordValue(value.doubleValue()); } else if (value instanceof Double || value instanceof Float) { this.doubles = HistogramUtil.toDoubleHistogram(values, 5); doubles.recordValue(value.doubleValue()); values = null; } else { values.recordValue(value.longValue()); } } this.percentiles = percentiles; }