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

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

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

Histogram.<init>介绍

暂无

代码示例

代码示例来源:origin: PipelineAI/pipeline

public static Histogram getNewHistogram() {
    return new Histogram(NUMBER_SIGNIFICANT_DIGITS);
  }
}

代码示例来源:origin: linkedin/parseq

private static Histogram createHistogram() {
 return new Histogram(1, 10000000000L, 3);
}

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

/**
 * Default Constructor.
 */
public Measurements() {
  histo = new Histogram(3600000000000L, 3);
  sysMs = 0;
  userMs = 0;
  gcMs = 0;
  memBytes = 0;
  uptimeSecs = 0;
  timeWindow = 0;
  acked = 0;
  failed = 0;
  topologyIds = new HashSet<>();
  workers = 0;
  executors = 0;
  hosts = 0;
  congested = new HashMap<>();
  skippedMaxSpoutMs = 0;
  uiCompleteLatency = 0.0;
}

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

@Override
public Histogram copy() {
  Histogram copy = new Histogram(this);
  copy.add(this);
  return copy;
}

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

@Override
public Histogram copyCorrectedForCoordinatedOmission(final long expectedIntervalBetweenValueSamples) {
  Histogram copy = new Histogram(this);
  copy.addWhileCorrectingForCoordinatedOmission(this, expectedIntervalBetweenValueSamples);
  return copy;
}

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

/**
 * (From the Constructor of Histogram)
 * Construct a Histogram given the Lowest and Highest values to be tracked and a number of significant
 * decimal digits. Providing a lowestDiscernibleValue is useful is situations where the units used
 * for the histogram's values are much smaller that the minimal accuracy required. E.g. when tracking
 * time values stated in nanosecond units, where the minimal accuracy required is a microsecond, the
 * proper value for lowestDiscernibleValue would be 1000.
 *
 * @param lowestDiscernibleValue         The lowest value that can be discerned (distinguished from 0) by the
 *                                       histogram. Must be a positive integer that is {@literal >=} 1. May be
 *                                       internally rounded down to nearest power of 2
 *                                       (if null 1 is used).
 * @param highestTrackableValue          The highest value to be tracked by the histogram. Must be a positive
 *                                       integer that is {@literal >=} (2 * lowestDiscernibleValue).
 *                                       (if null 2 * lowestDiscernibleValue is used and auto-resize is enabled)
 * @param numberOfSignificantValueDigits Specifies the precision to use. This is the number of significant
 *                                       decimal digits to which the histogram will maintain value resolution
 *                                       and separation. Must be a non-negative integer between 0 and 5.
 */
public HistogramMetric(Long lowestDiscernibleValue, Long highestTrackableValue,
         final int numberOfSignificantValueDigits) {
  boolean autoResize = false;
  if (lowestDiscernibleValue == null) lowestDiscernibleValue = 1L;
  if (highestTrackableValue == null) {
    highestTrackableValue = 2 * lowestDiscernibleValue;
    autoResize = true;
  }
  _histo = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits);
  if (autoResize) _histo.setAutoResize(true);
}

代码示例来源:origin: networknt/light-4j

/**
 * Create a reservoir with a user-specified recorder.
 *
 * @param recorder Recorder to use
 */
public HdrHistogramReservoir(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.
   * - it lets us figure out the number of significant digits to use in runningTotals.
   */
  intervalHistogram = recorder.getIntervalHistogram();
  runningTotals = new Histogram(intervalHistogram.getNumberOfSignificantValueDigits());
}

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

private void run() throws IOException
  final Histogram histogram = new Histogram(TimeUnit.SECONDS.toNanos(10), 3);
  final ByteBuffer buffer = ByteBuffer.allocateDirect(Configuration.MTU_LENGTH_DEFAULT);

代码示例来源:origin: org.apache.logging.log4j/log4j-core

final CountDownLatch LATCH = new CountDownLatch(threadCount);
for (int i = 0; i < threadCount; i++) {
  final Histogram serviceTmHist = new Histogram(TimeUnit.SECONDS.toNanos(10), 3);
  final Histogram responseTmHist = new Histogram(TimeUnit.SECONDS.toNanos(10), 3);
  serviceTmHistograms.add(serviceTmHist);
  responseTmHistograms.add(responseTmHist);

代码示例来源:origin: org.apache.logging.log4j/log4j-core

private static Histogram createResultHistogram(final List<Histogram> list, final long start, final long end) {
  final Histogram result = new Histogram(TimeUnit.SECONDS.toNanos(10), 3);
  result.setStartTimeStamp(start);
  result.setEndTimeStamp(end);
  for (final Histogram hist : list) {
    result.add(hist);
  }
  return result;
}

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

prevFailed = failed;
Histogram copy = new Histogram(3600000000000L, 3);;
synchronized (histo) {
  copy.add(histo);

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

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

代码示例来源: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: co.paralleluniverse/quasar-core

@Override
  protected AbstractHistogram newResource() {
    return new Histogram(StripedHistogram.this.highestTrackableValue, StripedHistogram.this.numberOfSignificantValueDigits);
  }
};

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

/**
* Initializes a new histogram based on the configuration proeprties.
*/
private void initRecorder() {
 if (maxExpectedValue == -1) {
   histogram = new Histogram(precision);
 } else {
   histogram = new Histogram(maxExpectedValue, precision);
 }
}

代码示例来源:origin: jpos/jPOS

private Histogram getHistogram (String p) {
  Histogram h = metrics.get(p);
  if (h == null) {
    Histogram hist = new Histogram(template);
    hist.setTag(p);
    metrics.putIfAbsent(p, hist);
    h = metrics.get(p);
  }
  return h;
}

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

@Override
public Histogram copy() {
  Histogram copy = new Histogram(this);
  copy.add(this);
  return copy;
}

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

public IntervalBucket(Histogram aggregateHistogram, long lowestDiscernibleValue, long highestTrackableValue, int numberOfSignificantDigits, Boolean autoResize) {
  this.aggregateHistogram = aggregateHistogram;
  this.intervalHistogram = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantDigits);
  if (autoResize) {
    this.intervalHistogram.setAutoResize(true);
  }
  this.state = IntervalState.EMPTY;
}

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

public IntervalBucket(Histogram aggregateHistogram, long lowestDiscernibleValue, long highestTrackableValue, int numberOfSignificantDigits, Boolean autoResize) {
  this.aggregateHistogram = aggregateHistogram;
  this.intervalHistogram = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantDigits);
  if (autoResize) {
    this.intervalHistogram.setAutoResize(true);
  }
  this.state = IntervalState.EMPTY;
}

代码示例来源:origin: co.paralleluniverse/quasar-core

public LatencyStatsReservoir(LatencyStats stats) {
  this.stats = stats;
  intervalHistogram = stats.getIntervalHistogram();
  runningTotals = new Histogram(intervalHistogram.getNumberOfSignificantValueDigits());
}

相关文章