當前位置: 首頁>>代碼示例>>Java>>正文


Java Histogram.getValueAtPercentile方法代碼示例

本文整理匯總了Java中org.HdrHistogram.Histogram.getValueAtPercentile方法的典型用法代碼示例。如果您正苦於以下問題:Java Histogram.getValueAtPercentile方法的具體用法?Java Histogram.getValueAtPercentile怎麽用?Java Histogram.getValueAtPercentile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.HdrHistogram.Histogram的用法示例。


在下文中一共展示了Histogram.getValueAtPercentile方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: interval

import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
public Snapshot interval() {
  final IntervalCount requestCount = count.interval();
  final IntervalCount responseTimeCount = responseTime.interval();
  final Histogram h = latency.getIntervalHistogram(histogram);
  final long c = requestCount.count();
  final double x = requestCount.rate();
  final long satisfied = h.getCountBetweenValues(0, goalLatency);
  final long tolerating = h.getCountBetweenValues(goalLatency, goalLatency * 4);
  final double p50 = h.getValueAtPercentile(50) * 1e-6;
  final double p90 = h.getValueAtPercentile(90) * 1e-6;
  final double p99 = h.getValueAtPercentile(99) * 1e-6;
  final double p999 = h.getValueAtPercentile(99.9) * 1e-6;
  this.histogram = h;
  final double r, n, apdex;
  if (c == 0) {
    r = n = apdex = 0;
  } else {
    r = responseTimeCount.rate() / c * 1e-6;
    n = x * r;
    apdex = Math.min(1.0, (satisfied + (tolerating / 2.0)) / c);
  }
  return new AutoValue_Snapshot(c, x, n, r, p50, p90, p99, p999, apdex);
}
 
開發者ID:codahale,項目名稱:grpc-proxy,代碼行數:24,代碼來源:Recorder.java

示例2: takeSmartSnapshot

import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
static Snapshot takeSmartSnapshot(final double[] predefinedQuantiles, Histogram histogram) {
    final long max = histogram.getMaxValue();
    final long min = histogram.getMinValue();
    final double mean = histogram.getMean();
    final double median = histogram.getValueAtPercentile(50.0);
    final double stdDeviation = histogram.getStdDeviation();

    final double[] values = new double[predefinedQuantiles.length];
    for (int i = 0; i < predefinedQuantiles.length; i++) {
        double quantile = predefinedQuantiles[i];
        double percentile = quantile * 100.0;
        values[i] = histogram.getValueAtPercentile(percentile);
    }

    return createSmartSnapshot(predefinedQuantiles, max, min, mean, median, stdDeviation, values);
}
 
開發者ID:vladimir-bukhtoyarov,項目名稱:rolling-metrics,代碼行數:17,代碼來源:HdrReservoir.java

示例3: scaledPercentile

import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
private static double scaledPercentile(
    final Histogram histogram,
    final double scalingFactor,
    final double percentile)
{
    return histogram.getValueAtPercentile(percentile) / scalingFactor;
}
 
開發者ID:real-logic,項目名稱:artio,代碼行數:8,代碼來源:HistogramLogReader.java

示例4: valueAtPercentile

import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
@Override
double valueAtPercentile(Histogram accumulatedHistogram, double percentile) {
    return accumulatedHistogram.getValueAtPercentile(percentile);
}
 
開發者ID:micrometer-metrics,項目名稱:micrometer,代碼行數:5,代碼來源:TimeWindowLatencyHistogram.java


注:本文中的org.HdrHistogram.Histogram.getValueAtPercentile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。