com.codahale.metrics.Snapshot.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(138)

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

Snapshot.getValue介绍

[英]Returns the value at the given quantile.
[中]返回给定分位数处的值。

代码示例

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

@Override
public double getQuantile(double quantile) {
  return snapshot.getValue(quantile);
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * Returns the value at the 75th percentile in the distribution.
 *
 * @return the value at the 75th percentile
 */
public double get75thPercentile() {
  return getValue(0.75);
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * Returns the value at the 98th percentile in the distribution.
 *
 * @return the value at the 98th percentile
 */
public double get98thPercentile() {
  return getValue(0.98);
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * Returns the median value in the distribution.
 *
 * @return the median value
 */
public double getMedian() {
  return getValue(0.5);
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * Returns the value at the 95th percentile in the distribution.
 *
 * @return the value at the 95th percentile
 */
public double get95thPercentile() {
  return getValue(0.95);
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * Returns the value at the 99th percentile in the distribution.
 *
 * @return the value at the 99th percentile
 */
public double get99thPercentile() {
  return getValue(0.99);
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

/**
 * Returns the value at the 99.9th percentile in the distribution.
 *
 * @return the value at the 99.9th percentile
 */
public double get999thPercentile() {
  return getValue(0.999);
}

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

public static boolean isFasterThanXPercentOfAllRequests(long executionTimeNanos, double percentileLimit, Timer timer) {
  boolean faster = true;
  if (percentileLimit > 0) {
    if (percentileLimit >= 1) {
      faster = false;
    } else {
      final double percentile = timer.getSnapshot().getValue(percentileLimit);
      if (executionTimeNanos < percentile) {
        faster = false;
      }
    }
  }
  return faster;
}

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

/** @return a summary of {@code hist}. */
public static String getHistogramReport(final Histogram hist) {
 Snapshot sn = hist.getSnapshot();
 return "mean=" + DOUBLE_FORMAT.format(sn.getMean()) +
   ", min=" + DOUBLE_FORMAT.format(sn.getMin()) +
   ", max=" + DOUBLE_FORMAT.format(sn.getMax()) +
   ", stdDev=" + DOUBLE_FORMAT.format(sn.getStdDev()) +
   ", 50th=" + DOUBLE_FORMAT.format(sn.getMedian()) +
   ", 75th=" + DOUBLE_FORMAT.format(sn.get75thPercentile()) +
   ", 95th=" + DOUBLE_FORMAT.format(sn.get95thPercentile()) +
   ", 99th=" + DOUBLE_FORMAT.format(sn.get99thPercentile()) +
   ", 99.9th=" + DOUBLE_FORMAT.format(sn.get999thPercentile()) +
   ", 99.99th=" + DOUBLE_FORMAT.format(sn.getValue(0.9999)) +
   ", 99.999th=" + DOUBLE_FORMAT.format(sn.getValue(0.99999));
}

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

/** @return pretty summary of {@code hist}. */
 public static String getPrettyHistogramReport(final Histogram h) {
  Snapshot sn = h.getSnapshot();
  return
    "Mean      = " + DOUBLE_FORMAT.format(sn.getMean()) + "\n" +
    "Min       = " + DOUBLE_FORMAT.format(sn.getMin()) + "\n" +
    "Max       = " + DOUBLE_FORMAT.format(sn.getMax()) + "\n" +
    "StdDev    = " + DOUBLE_FORMAT.format(sn.getStdDev()) + "\n" +
    "50th      = " + DOUBLE_FORMAT.format(sn.getMedian()) + "\n" +
    "75th      = " + DOUBLE_FORMAT.format(sn.get75thPercentile()) + "\n" +
    "95th      = " + DOUBLE_FORMAT.format(sn.get95thPercentile()) + "\n" +
    "99th      = " + DOUBLE_FORMAT.format(sn.get99thPercentile()) + "\n" +
    "99.9th    = " + DOUBLE_FORMAT.format(sn.get999thPercentile()) + "\n" +
    "99.99th   = " + DOUBLE_FORMAT.format(sn.getValue(0.9999)) + "\n" +
    "99.999th  = " + DOUBLE_FORMAT.format(sn.getValue(0.99999));
 }
}

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

@Override
 double apply(Histogram hist) {
  return hist.getSnapshot().getValue(0.9999);
 }
};

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

private String reportHistogramSnapshot(Snapshot snapshot) {
  return "min=" + snapshot.getMin() + ","
      + "max=" + snapshot.getMax() + ","
      + "mean=" + snapshot.getMean() + ","
      + "p50=" + snapshot.getMedian() + ","
      + "std=" + snapshot.getStdDev() + ","
      + "p25=" + snapshot.getValue(0.25) + ","
      + "p75=" + snapshot.get75thPercentile() + ","
      + "p95=" + snapshot.get95thPercentile() + ","
      + "p98=" + snapshot.get98thPercentile() + ","
      + "p99=" + snapshot.get99thPercentile() + ","
      + "p999=" + snapshot.get999thPercentile();
}

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

private String reportTimerSnapshot(Snapshot snapshot) {
  return "min=" + getDuration(snapshot.getMin()) + ","
      + "max=" + getDuration(snapshot.getMax()) + ","
      + "mean=" + getDuration(snapshot.getMean()) + ","
      + "p50=" + getDuration(snapshot.getMedian()) + ","
      + "std=" + getDuration(snapshot.getStdDev()) + ","
      + "p25=" + getDuration(snapshot.getValue(0.25)) + ","
      + "p75=" + getDuration(snapshot.get75thPercentile()) + ","
      + "p95=" + getDuration(snapshot.get95thPercentile()) + ","
      + "p98=" + getDuration(snapshot.get98thPercentile()) + ","
      + "p99=" + getDuration(snapshot.get99thPercentile()) + ","
      + "p999=" + getDuration(snapshot.get999thPercentile());
}

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

private void writeHistogramSnapshot(Snapshot snapshot, JsonGenerator jg) throws IOException {
  writeDoubleUnlessNaN(jg, "min", snapshot.getMin());
  writeDoubleUnlessNaN(jg, "max", snapshot.getMax());
  writeDoubleUnlessNaN(jg, "mean", snapshot.getMean());
  writeDoubleUnlessNaN(jg, "p50", snapshot.getMedian());
  writeDoubleUnlessNaN(jg, "std", snapshot.getStdDev());
  writeDoubleUnlessNaN(jg, "p25", snapshot.getValue(0.25));
  writeDoubleUnlessNaN(jg, "p75", snapshot.get75thPercentile());
  writeDoubleUnlessNaN(jg, "p95", snapshot.get95thPercentile());
  writeDoubleUnlessNaN(jg, "p98", snapshot.get98thPercentile());
  writeDoubleUnlessNaN(jg, "p99", snapshot.get99thPercentile());
  writeDoubleUnlessNaN(jg, "p999", snapshot.get999thPercentile());
}

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

private void writeTimerSnapshot(Snapshot snapshot, JsonGenerator jg) throws IOException {
  writeDoubleUnlessNaN(jg, "min", convertDuration(snapshot.getMin()));
  writeDoubleUnlessNaN(jg, "max", convertDuration(snapshot.getMax()));
  writeDoubleUnlessNaN(jg, "mean", convertDuration(snapshot.getMean()));
  writeDoubleUnlessNaN(jg, "p50", convertDuration(snapshot.getMedian()));
  writeDoubleUnlessNaN(jg, "std", convertDuration(snapshot.getStdDev()));
  writeDoubleUnlessNaN(jg, "p25", convertDuration(snapshot.getValue(0.25)));
  writeDoubleUnlessNaN(jg, "p75", convertDuration(snapshot.get75thPercentile()));
  writeDoubleUnlessNaN(jg, "p95", convertDuration(snapshot.get95thPercentile()));
  writeDoubleUnlessNaN(jg, "p98", convertDuration(snapshot.get98thPercentile()));
  writeDoubleUnlessNaN(jg, "p99", convertDuration(snapshot.get99thPercentile()));
  writeDoubleUnlessNaN(jg, "p999", convertDuration(snapshot.get999thPercentile()));
}

代码示例来源:origin: com.codahale.metrics/metrics-core

/**
 * Returns the value at the 99.9th percentile in the distribution.
 *
 * @return the value at the 99.9th percentile
 */
public double get999thPercentile() {
  return getValue(0.999);
}

代码示例来源:origin: com.codahale.metrics/metrics-core

/**
 * Returns the median value in the distribution.
 *
 * @return the median value
 */
public double getMedian() {
  return getValue(0.5);
}

代码示例来源:origin: com.codahale.metrics/metrics-core

/**
 * Returns the value at the 75th percentile in the distribution.
 *
 * @return the value at the 75th percentile
 */
public double get75thPercentile() {
  return getValue(0.75);
}

代码示例来源:origin: com.codahale.metrics/metrics-core

/**
 * Returns the value at the 98th percentile in the distribution.
 *
 * @return the value at the 98th percentile
 */
public double get98thPercentile() {
  return getValue(0.98);
}

代码示例来源:origin: uber/hudi

private Comparable[] printFileSizeHistogram(String commitTime, Snapshot s) {
 return new Comparable[]{commitTime, s.getMin(),
   s.getValue(0.1), s.getMedian(),
   s.getMean(), s.get95thPercentile(),
   s.getMax(), s.size(),
   s.getStdDev()};
}

相关文章