本文整理了Java中org.HdrHistogram.Histogram.recordValue()
方法的一些代码示例,展示了Histogram.recordValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.recordValue()
方法的具体详情如下:
包路径:org.HdrHistogram.Histogram
类名称:Histogram
方法名:recordValue
暂无
代码示例来源:origin: apache/storm
public void recordValue(long val) {
_histo.recordValue(val);
}
代码示例来源:origin: HdrHistogram/HdrHistogram
/**
* @deprecated
*/
@Override
public synchronized void recordValue(final long value, final long expectedIntervalBetweenValueSamples)
throws ArrayIndexOutOfBoundsException {
super.recordValue(value, expectedIntervalBetweenValueSamples);
}
代码示例来源:origin: HdrHistogram/HdrHistogram
@Override
public synchronized void recordValue(final long value) throws ArrayIndexOutOfBoundsException {
super.recordValue(value);
}
代码示例来源:origin: real-logic/aeron
@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);
}
代码示例来源:origin: real-logic/aeron
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);
}
代码示例来源:origin: real-logic/aeron
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;
}
代码示例来源:origin: HdrHistogram/HdrHistogram
/**
* 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);
}
}
代码示例来源:origin: real-logic/aeron
histogram.recordValue(duration);
代码示例来源:origin: linkedin/parseq
@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;
}
代码示例来源:origin: real-logic/aeron
histogram.recordValue(duration);
代码示例来源:origin: PipelineAI/pipeline
@Override
public Histogram call(Histogram initialDistribution, HystrixCommandCompletion event) {
if (event.didCommandExecute() && event.getTotalLatency() > -1) {
initialDistribution.recordValue(event.getTotalLatency());
}
return initialDistribution;
}
};
代码示例来源:origin: PipelineAI/pipeline
@Override
public Histogram call(Histogram initialDistribution, HystrixCommandCompletion event) {
if (event.didCommandExecute() && event.getExecutionLatency() > -1) {
initialDistribution.recordValue(event.getExecutionLatency());
}
return initialDistribution;
}
};
代码示例来源:origin: linkedin/parseq
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());
});
}
代码示例来源:origin: real-logic/aeron
histogram.recordValue(duration);
代码示例来源:origin: PipelineAI/pipeline
@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;
}
};
代码示例来源:origin: org.apache.logging.log4j/log4j-core
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);
}
}
代码示例来源:origin: glowroot/glowroot
@VisibleForTesting
public void add(long value) {
ensureCapacity(size + 1);
if (histogram != null) {
histogram.recordValue(value);
} else {
values[size++] = value;
sorted = false;
}
}
代码示例来源:origin: glowroot/glowroot
@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];
}
代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures
@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;
}
代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures
@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;
}
内容来源于网络,如有侵权,请联系作者删除!