org.HdrHistogram.Histogram.reset()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中org.HdrHistogram.Histogram.reset()方法的一些代码示例,展示了Histogram.reset()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.reset()方法的具体详情如下:
包路径:org.HdrHistogram.Histogram
类名称:Histogram
方法名:reset

Histogram.reset介绍

暂无

代码示例

代码示例来源:origin: HdrHistogram/HdrHistogram

@Override
public synchronized void reset() {
  super.reset();
}

代码示例来源:origin: apache/storm

@Override
  public Object getValueAndReset() {
     Histogram copy = _histo.copy();
     _histo.reset();
     return copy;
  }
}

代码示例来源:origin: real-logic/aeron

private void run() throws IOException
{
  receiveChannel = DatagramChannel.open();
  Common.init(receiveChannel);
  receiveChannel.bind(new InetSocketAddress("localhost", Common.PONG_PORT));
  final DatagramChannel sendChannel = DatagramChannel.open();
  Common.init(sendChannel);
  final Selector selector = Selector.open();
  receiveChannel.register(selector, OP_READ, this);
  final NioSelectedKeySet keySet = Common.keySet(selector);
  final AtomicBoolean running = new AtomicBoolean(true);
  SigInt.register(() -> running.set(false));
  while (running.get())
  {
    measureRoundTrip(HISTOGRAM, SEND_ADDRESS, buffer, sendChannel, selector, keySet, running);
    HISTOGRAM.reset();
    System.gc();
    LockSupport.parkNanos(1000 * 1000 * 1000);
  }
}

代码示例来源:origin: real-logic/aeron

histogram.reset();
System.gc();
LockSupport.parkNanos(1000 * 1000 * 1000);

代码示例来源:origin: real-logic/aeron

HISTOGRAM.reset();
System.out.format("Pinging %,d messages%n", NUMBER_OF_MESSAGES);

代码示例来源:origin: real-logic/aeron

HISTOGRAM.reset();
System.out.println("Pinging " + NUMBER_OF_MESSAGES + " messages");

代码示例来源:origin: apache/storm

synchronized (histo) {
  copy.add(histo);
  histo.reset();

代码示例来源:origin: HdrHistogram/HdrHistogram

inactiveHistogram.reset();

代码示例来源:origin: HdrHistogram/HdrHistogram

new Histogram(3) :
    ((Histogram) intervalHistogram).copy();
accumulatedRegularHistogram.reset();
accumulatedRegularHistogram.setAutoResize(true);

代码示例来源:origin: org.hdrhistogram/HdrHistogram

@Override
public synchronized void reset() {
  super.reset();
}

代码示例来源:origin: com.github.vladimir-bukhtoyarov/rolling-metrics

public static void reset(Histogram histogram) {
  if (histogram.getTotalCount() > 0) {
    histogram.reset();
  }
}

代码示例来源:origin: com.hotels.styx/styx-api

public void reset() {
  if (this.state == IntervalState.AGGREGATED) {
    aggregateHistogram.subtract(this.intervalHistogram);
  }
  this.intervalHistogram.reset();
  this.state = IntervalState.EMPTY;
}

代码示例来源:origin: vladimir-bukhtoyarov/rolling-metrics

public static void reset(Histogram histogram) {
  if (histogram.getTotalCount() > 0) {
    histogram.reset();
  }
}

代码示例来源:origin: HotelsDotCom/styx

public void reset() {
  if (this.state == IntervalState.AGGREGATED) {
    aggregateHistogram.subtract(this.intervalHistogram);
  }
  this.intervalHistogram.reset();
  this.state = IntervalState.EMPTY;
}

代码示例来源:origin: real-logic/benchmarks

private static void testRun() throws InterruptedException
{
  pingValue = -1;
  pongValue = -1;
  histogram.reset();
  final Thread sendThread = new Thread(new PingRunner());
  final Thread echoThread = new Thread(new PongRunner());
  echoThread.start();
  sendThread.start();
  echoThread.join();
  out.println("pingValue = " + pingValue + ", pongValue = " + pongValue);
  System.out.println("Histogram of RTT latencies in microseconds.");
  histogram.outputPercentileDistribution(System.out, 1000.0);
}

代码示例来源:origin: paritytrading/nassau

private static void main(InetSocketAddress address, int packets) throws IOException {
  final Client client = Client.connect(address);
  ByteBuffer buffer = ByteBuffer.wrap(new byte[] { 'f', 'o', 'o' });
  System.out.println("Warming up...");
  for (int i = 0; i < packets; i++) {
    client.send(buffer);
    buffer.flip();
    client.receive();
  }
  client.getHistogram().reset();
  System.out.println("Benchmarking...");
  for (int i = 0; i < packets; i++) {
    client.send(buffer);
    buffer.flip();
    client.receive();
  }
  client.close();
  System.out.printf("Results (n = %d):\n", packets);
  System.out.printf("\n");
  System.out.printf( "      Min: %10.2f µs\n", client.getHistogram().getMinValue()                / 1000.0);
  System.out.printf("   50.00%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(50.00)  / 1000.0);
  System.out.printf("   90.00%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(90.00)  / 1000.0);
  System.out.printf("   99.00%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(99.00)  / 1000.0);
  System.out.printf("   99.90%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(99.90)  / 1000.0);
  System.out.printf("   99.99%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(99.99)  / 1000.0);
  System.out.printf("  100.00%%: %10.2f µs\n", client.getHistogram().getValueAtPercentile(100.00) / 1000.0);
  System.out.printf("\n");
}

代码示例来源:origin: LatencyUtils/LatencyUtils

private synchronized void updateHistograms() {
  try {
    recordingPhaser.readerLock();
    inactiveRawDataHistogram.reset();
    inactivePauseCorrectionsHistogram.reset();
    swapHistograms();
    long now = System.currentTimeMillis();
    activeRecordingHistogram.setStartTimeStamp(now);
    activePauseCorrectionsHistogram.setStartTimeStamp(now);
    inactiveRawDataHistogram.setEndTimeStamp(now);
    inactivePauseCorrectionsHistogram.setEndTimeStamp(now);
    // Make sure we are not in the middle of recording a value on the previously current recording histogram:
    // Flip phase on epochs to make sure no in-flight recordings are active on pre-flip phase:
    recordingPhaser.flipPhase();
  } finally {
    recordingPhaser.readerUnlock();
  }
}

代码示例来源:origin: org.latencyutils/LatencyUtils

private synchronized void updateHistograms() {
  try {
    recordingPhaser.readerLock();
    inactiveRawDataHistogram.reset();
    inactivePauseCorrectionsHistogram.reset();
    swapHistograms();
    long now = System.currentTimeMillis();
    activeRecordingHistogram.setStartTimeStamp(now);
    activePauseCorrectionsHistogram.setStartTimeStamp(now);
    inactiveRawDataHistogram.setEndTimeStamp(now);
    inactivePauseCorrectionsHistogram.setEndTimeStamp(now);
    // Make sure we are not in the middle of recording a value on the previously current recording histogram:
    // Flip phase on epochs to make sure no in-flight recordings are active on pre-flip phase:
    recordingPhaser.flipPhase();
  } finally {
    recordingPhaser.readerUnlock();
  }
}

代码示例来源:origin: org.hdrhistogram/HdrHistogram

inactiveHistogram.reset();

代码示例来源:origin: paritytrading/philadelphia

initiator.getHistogram().reset();

相关文章