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

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

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

Histogram.recordValueWithExpectedInterval介绍

暂无

代码示例

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

@Override
public synchronized void recordValueWithExpectedInterval(final long value, final long expectedIntervalBetweenValueSamples)
    throws ArrayIndexOutOfBoundsException {
  super.recordValueWithExpectedInterval(value, expectedIntervalBetweenValueSamples);
}

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

/**
 * Record a value
 * <p>
 * To compensate for the loss of sampled values when a recorded value is larger than the expected
 * interval between value samples, Histogram will auto-generate an additional series of decreasingly-smaller
 * (down to the expectedIntervalBetweenValueSamples) value records.
 * <p>
 * See related notes {@link AbstractHistogram#recordValueWithExpectedInterval(long, long)}
 * for more explanations about coordinated omission and expected interval correction.
 *      *
 * @param value The value to record
 * @param expectedIntervalBetweenValueSamples If expectedIntervalBetweenValueSamples is larger than 0, add
 *                                           auto-generated value records as appropriate if value is larger
 *                                           than expectedIntervalBetweenValueSamples
 * @throws ArrayIndexOutOfBoundsException (may throw) if value is exceeds highestTrackableValue
 */
@Override
public void recordValueWithExpectedInterval(final long value, final long expectedIntervalBetweenValueSamples)
    throws ArrayIndexOutOfBoundsException {
  long criticalValueAtEnter = recordingPhaser.writerCriticalSectionEnter();
  try {
    activeHistogram.recordValueWithExpectedInterval(value, expectedIntervalBetweenValueSamples);
  } finally {
    recordingPhaser.writerCriticalSectionExit(criticalValueAtEnter);
  }
}

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

@Override
public synchronized void recordValueWithExpectedInterval(final long value, final long expectedIntervalBetweenValueSamples)
    throws ArrayIndexOutOfBoundsException {
  super.recordValueWithExpectedInterval(value, expectedIntervalBetweenValueSamples);
}

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

/**
 * Record a value
 * <p>
 * To compensate for the loss of sampled values when a recorded value is larger than the expected
 * interval between value samples, Histogram will auto-generate an additional series of decreasingly-smaller
 * (down to the expectedIntervalBetweenValueSamples) value records.
 * <p>
 * See related notes {@link AbstractHistogram#recordValueWithExpectedInterval(long, long)}
 * for more explanations about coordinated omission and expected interval correction.
 *      *
 * @param value The value to record
 * @param expectedIntervalBetweenValueSamples If expectedIntervalBetweenValueSamples is larger than 0, add
 *                                           auto-generated value records as appropriate if value is larger
 *                                           than expectedIntervalBetweenValueSamples
 * @throws ArrayIndexOutOfBoundsException (may throw) if value is exceeds highestTrackableValue
 */
@Override
public void recordValueWithExpectedInterval(final long value, final long expectedIntervalBetweenValueSamples)
    throws ArrayIndexOutOfBoundsException {
  long criticalValueAtEnter = recordingPhaser.writerCriticalSectionEnter();
  try {
    activeHistogram.recordValueWithExpectedInterval(value, expectedIntervalBetweenValueSamples);
  } finally {
    recordingPhaser.writerCriticalSectionExit(criticalValueAtEnter);
  }
}

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

private synchronized void recordDetectedPause(long pauseLength, long pauseEndTime) {
  long criticalValueAtEnter = recordingPhaser.writerCriticalSectionEnter();
  try {
    long estimatedInterval = intervalEstimator.getEstimatedInterval(pauseEndTime);
    long observedLatencyMinbar = pauseLength - estimatedInterval;
    if (observedLatencyMinbar >= estimatedInterval) {
      activePauseCorrectionsHistogram.recordValueWithExpectedInterval(
          observedLatencyMinbar,
          estimatedInterval
      );
    }
  } finally {
    recordingPhaser.writerCriticalSectionExit(criticalValueAtEnter);
  }
}

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

private synchronized void recordDetectedPause(long pauseLength, long pauseEndTime) {
  long criticalValueAtEnter = recordingPhaser.writerCriticalSectionEnter();
  try {
    long estimatedInterval = intervalEstimator.getEstimatedInterval(pauseEndTime);
    long observedLatencyMinbar = pauseLength - estimatedInterval;
    if (observedLatencyMinbar >= estimatedInterval) {
      activePauseCorrectionsHistogram.recordValueWithExpectedInterval(
          observedLatencyMinbar,
          estimatedInterval
      );
    }
  } finally {
    recordingPhaser.writerCriticalSectionExit(criticalValueAtEnter);
  }
}

相关文章