本文整理了Java中org.HdrHistogram.Recorder
类的一些代码示例,展示了Recorder
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Recorder
类的具体详情如下:
包路径:org.HdrHistogram.Recorder
类名称:Recorder
暂无
代码示例来源:origin: HdrHistogram/HdrHistogram
/**
* Get a new instance of an interval histogram, which will include a stable, consistent view of all value
* counts accumulated since the last interval histogram was taken.
* <p>
* Calling {@link Recorder#getIntervalHistogram()} will reset
* the value counts, and start accumulating value counts for the next interval.
*
* @return a histogram containing the value counts accumulated since the last interval histogram was taken.
*/
public synchronized Histogram getIntervalHistogram() {
return getIntervalHistogram(null);
}
代码示例来源:origin: brianfrankcooper/YCSB
/**
* It appears latency is reported in micros.
* Using {@link Recorder} to support concurrent updates to histogram.
*/
public void measure(int latencyInMicros) {
histogram.recordValue(latencyInMicros);
}
代码示例来源:origin: networknt/light-4j
/**
* Create a reservoir with a default recorder. This recorder should be suitable for most usage.
*/
public HdrHistogramResetOnSnapshotReservoir() {
this(new Recorder(2));
}
代码示例来源:origin: rsocket/rsocket-java
public Recorder startTracker(Duration interval) {
final Recorder histogram = new Recorder(3600000000000L, 3);
Flux.interval(interval)
.doOnNext(
aLong -> {
System.out.println("---- PING/ PONG HISTO ----");
histogram
.getIntervalHistogram()
.outputPercentileDistribution(System.out, 5, 1000.0, false);
System.out.println("---- PING/ PONG HISTO ----");
})
.subscribe();
return histogram;
}
代码示例来源:origin: org.apache.pulsar/pulsar-testclient
if (now > warmupEndTime) {
long latencyMicros = NANOSECONDS.toMicros(now - sendTime);
recorder.recordValue(latencyMicros);
cumulativeRecorder.recordValue(latencyMicros);
double throughput = bytesSent.sumThenReset() / elapsed / 1024 / 1024 * 8;
reportHistogram = recorder.getIntervalHistogram(reportHistogram);
代码示例来源:origin: io.engineblock/eb-api
/**
* Create a reservoir with a default recorder. This recorder should be suitable for most usage.
*
* @param name the name to give to the reservoir, for logging purposes
* @param significantDigits how many significant digits to track in the reservoir
*/
public DeltaHdrHistogramReservoir(String name, int significantDigits) {
this.metricName = name;
this.recorder = new Recorder(significantDigits);
/*
* 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();
lastHistogram = new Histogram(intervalHistogram.getNumberOfSignificantValueDigits());
}
代码示例来源:origin: org.apache.pulsar/pulsar-testclient
recorder.recordValue(latencyMillis);
cumulativeRecorder.recordValue(latencyMillis);
double throughput = bytesReceived.sumThenReset() / elapsed * 8 / 1024 / 1024;
reportHistogram = recorder.getIntervalHistogram(reportHistogram);
代码示例来源:origin: networknt/light-4j
/**
* Create a reservoir with a user-specified recorder.
*
* @param recorder Recorder to use
*/
public HdrHistogramResetOnSnapshotReservoir(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.
*/
intervalHistogram = recorder.getIntervalHistogram();
}
代码示例来源:origin: networknt/light-4j
@Override
public void update(long value) {
recorder.recordValue(value);
}
代码示例来源:origin: linkedin/parseq
private void initializeRecorder() {
if (_recorder == null) {
_recorder = new Recorder(LOWEST_DISCERNIBLE_VALUE, HIGHEST_TRACKABLE_VALUE, NUMBER_OF_FIGNIFICANT_VALUE_DIGITS);
}
}
代码示例来源:origin: io.reactivesocket/reactivesocket-test
public Recorder startTracker(Duration interval) {
final Recorder histogram = new Recorder(3600000000000L, 3);
Flux.interval(interval)
.doOnNext(aLong -> {
System.out.println("---- PING/ PONG HISTO ----");
histogram.getIntervalHistogram()
.outputPercentileDistribution(System.out, 5, 1000.0, false);
System.out.println("---- PING/ PONG HISTO ----");
})
.subscribe();
return histogram;
}
代码示例来源:origin: HdrHistogram/HdrHistogram
return getIntervalHistogram(histogramToRecycle, true);
代码示例来源:origin: networknt/light-4j
@Override
public void update(long value) {
recorder.recordValue(value);
}
代码示例来源:origin: networknt/light-4j
/**
* Create a reservoir with a default recorder. This recorder should be suitable for most usage.
*/
public HdrHistogramReservoir() {
this(new Recorder(2));
}
代码示例来源:origin: brianfrankcooper/YCSB
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;
}
代码示例来源:origin: linkedin/parseq
private synchronized void recordSafeValue(long batchAggregationTimeNano) {
initializeRecorder();
_recorder.recordValue(batchAggregationTimeNano);
}
代码示例来源:origin: linkedin/parseq
private void initializeRecorder() {
if (_recorder == null) {
_recorder = new Recorder(LOWEST_DISCERNIBLE_VALUE, HIGHEST_TRACKABLE_VALUE, NUMBER_OF_FIGNIFICANT_VALUE_DIGITS);
}
}
代码示例来源:origin: networknt/light-4j
/**
* @return a copy of the accumulated state since the reservoir last had a snapshot
*/
@Nonnull
private synchronized Histogram getDataSinceLastSnapshotAndReset() {
intervalHistogram = recorder.getIntervalHistogram(intervalHistogram);
return intervalHistogram.copy();
}
}
代码示例来源:origin: linkedin/parseq
private synchronized void recordSafeValue(int batchSize) {
initializeRecorder();
_recorder.recordValue(batchSize);
}
代码示例来源:origin: brianfrankcooper/YCSB
public OneMeasurementHdrHistogram(String name, Properties props) {
super(name);
percentiles = getPercentileValues(props.getProperty(PERCENTILES_PROPERTY, PERCENTILES_PROPERTY_DEFAULT));
verbose = Boolean.valueOf(props.getProperty(VERBOSE_PROPERTY, String.valueOf(false)));
boolean shouldLog = Boolean.parseBoolean(props.getProperty("hdrhistogram.fileoutput", "false"));
if (!shouldLog) {
log = null;
histogramLogWriter = null;
} else {
try {
final String hdrOutputFilename = props.getProperty("hdrhistogram.output.path", "") + name + ".hdr";
log = new PrintStream(new FileOutputStream(hdrOutputFilename), false);
} catch (FileNotFoundException e) {
throw new RuntimeException("Failed to open hdr histogram output file", e);
}
histogramLogWriter = new HistogramLogWriter(log);
histogramLogWriter.outputComment("[Logging for: " + name + "]");
histogramLogWriter.outputLogFormatVersion();
long now = System.currentTimeMillis();
histogramLogWriter.outputStartTime(now);
histogramLogWriter.setBaseTime(now);
histogramLogWriter.outputLegend();
}
histogram = new Recorder(3);
}
内容来源于网络,如有侵权,请联系作者删除!