com.yammer.metrics.core.Timer.max()方法的使用及代码示例

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

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

Timer.max介绍

[英]Returns the longest recorded duration.
[中]返回记录的最长持续时间。

代码示例

代码示例来源:origin: linkedin/cruise-control

context.brokerId(),
                     metricName,
                     timer.max(),
                     MetricsUtils.ATTRIBUTE_MAX);
context.reporter().sendCruiseControlMetric(ccm);

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

@Override
public double getMax() {
  return metric.max();
}

代码示例来源:origin: urbanairship/statshtable

@Override
public double max() {
  return t.max();
}

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

@Override
public void processTimer(MetricName name, Timer timer, Context context) throws IOException {
  final PrintStream stream = context.getStream("# time,min,max,mean,median,stddev,95%,99%,99.9%");
  final Snapshot snapshot = timer.getSnapshot();
  stream.append(new StringBuilder()
             .append(timer.min()).append(',')
             .append(timer.max()).append(',')
             .append(timer.mean()).append(',')
             .append(snapshot.getMedian()).append(',')
             .append(timer.stdDev()).append(',')
             .append(snapshot.get95thPercentile()).append(',')
             .append(snapshot.get99thPercentile()).append(',')
             .append(snapshot.get999thPercentile()).toString())
      .println();
  stream.flush();
}

代码示例来源:origin: amient/kafka-metrics

@Override
public void processTimer(MetricName name, Timer timer, Long timestamp) {
  Map<String, Double> fields = new HashMap<String, Double>();
  fields.put("Count", Double.valueOf(timer.count()));
  fields.put("MeanRate", timer.meanRate());
  fields.put("FifteenMinuteRate", timer.fifteenMinuteRate());
  fields.put("FiveMinuteRate", timer.fiveMinuteRate());
  fields.put("OneMinuteRate", timer.oneMinuteRate());
  fields.put("Max", timer.max());
  fields.put("Mean", timer.mean());
  fields.put("Min", timer.min());
  fields.put("StdDev", timer.stdDev());
  fields.put("Sum", timer.sum());
  publish(createMeasurement(name, timestamp, fixedTags, fields));
}

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

@Override
public void processTimer(MetricName name, Timer timer, PrintStream stream) {
  processMeter(name, timer, stream);
  final String durationUnit = abbrev(timer.durationUnit());
  final Snapshot snapshot = timer.getSnapshot();
  stream.printf(locale, "               min = %2.2f%s\n", timer.min(), durationUnit);
  stream.printf(locale, "               max = %2.2f%s\n", timer.max(), durationUnit);
  stream.printf(locale, "              mean = %2.2f%s\n", timer.mean(), durationUnit);
  stream.printf(locale, "            stddev = %2.2f%s\n", timer.stdDev(), durationUnit);
  stream.printf(locale, "            median = %2.2f%s\n", snapshot.getMedian(), durationUnit);
  stream.printf(locale, "              75%% <= %2.2f%s\n", snapshot.get75thPercentile(), durationUnit);
  stream.printf(locale, "              95%% <= %2.2f%s\n", snapshot.get95thPercentile(), durationUnit);
  stream.printf(locale, "              98%% <= %2.2f%s\n", snapshot.get98thPercentile(), durationUnit);
  stream.printf(locale, "              99%% <= %2.2f%s\n", snapshot.get99thPercentile(), durationUnit);
  stream.printf(locale, "            99.9%% <= %2.2f%s\n", snapshot.get999thPercentile(), durationUnit);
}

代码示例来源:origin: addthis/metrics-reporter-config

private void addSnapshotDataObjectWithConvertDuration(MetricName key, Timer timer, List<DataObject> dataObjectList) {
  Snapshot snapshot = timer.getSnapshot();
  dataObjectList.add(toDataObject(key, ".min", convertDuration(timer.min())));
  dataObjectList.add(toDataObject(key, ".max", convertDuration(timer.max())));
  dataObjectList.add(toDataObject(key, ".mean", convertDuration(timer.mean())));
  dataObjectList.add(toDataObject(key, ".stddev", convertDuration(timer.stdDev())));
  dataObjectList.add(toDataObject(key, ".median", convertDuration(snapshot.getMedian())));
  dataObjectList.add(toDataObject(key, ".75th", convertDuration(snapshot.get75thPercentile())));
  dataObjectList.add(toDataObject(key, ".95th", convertDuration(snapshot.get95thPercentile())));
  dataObjectList.add(toDataObject(key, ".98th", convertDuration(snapshot.get98thPercentile())));
  dataObjectList.add(toDataObject(key, ".99th", convertDuration(snapshot.get99thPercentile())));
  dataObjectList.add(toDataObject(key, ".99.9th", convertDuration(snapshot.get999thPercentile())));
}

代码示例来源:origin: addthis/MetricCatcher

@Test
public void testRun_TimerMetric() throws IOException, InterruptedException {
  // input is in seconds
  double minValue = 0.32097400;
  double maxValue = 11111173;
  String json = "[" +
           "{\"name\":\"" + metricName + "\"," +
           "\"value\":" + minValue + "," +
           "\"type\":\"timer\"," +
           "\"timestamp\":1316647781}," +
           "{\"name\":\"" + metricName + "\"," +
           "\"value\":" + maxValue + "," +
           "\"type\":\"timer\"," +
           "\"timestamp\":1316647781}" +
         "]";
  byte[] jsonBytes = json.getBytes();
  sendingSocket.send(new DatagramPacket(jsonBytes, jsonBytes.length, localhost, listeningSocket.getLocalPort()));
  metricCatcher.start();
  Thread.sleep(500);
  metricCatcher.shutdown();
  double minval = ((Timer) metricCache.get(metricName)).min();
  // duration scale unit is milliseconds
  assertEquals(minValue * 1e3, minval, 1);
  assertEquals(maxValue * 1e3, ((Timer) metricCache.get(metricName)).max(), 1);
}

代码示例来源:origin: addthis/hydra

when(timer.fiveMinuteRate()).thenReturn(4.0);
when(timer.fifteenMinuteRate()).thenReturn(5.0);
when(timer.max()).thenReturn(2.0);
when(timer.mean()).thenReturn(3.0);
when(timer.min()).thenReturn(4.0);

代码示例来源:origin: com.linkedin.cruisecontrol/cruise-control-metrics-reporter

context.brokerId(),
                     metricName,
                     timer.max(),
                     MetricsUtils.ATTRIBUTE_MAX);
context.reporter().sendCruiseControlMetric(ccm);

代码示例来源:origin: addthis/hydra

@Override
public void processTimer(MetricName name, Timer timer, String x) throws IOException {
  processMeter(name, timer, x);
  final String sanitizedName = sanitizeName(name);
  final Snapshot snapshot = timer.getSnapshot();
  final String durationUnit = timer.durationUnit().name();
  printDoubleField(sanitizedName + ".min", timer.min(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".max", timer.max(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".mean", timer.mean(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".stddev", timer.stdDev(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".median", snapshot.getMedian(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".75percentile", snapshot.get75thPercentile(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".95percentile", snapshot.get95thPercentile(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".98percentile", snapshot.get98thPercentile(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".99percentile", snapshot.get99thPercentile(), "timer", durationUnit);
  printDoubleField(sanitizedName + ".999percentile", snapshot.get999thPercentile(), "timer", durationUnit);
}

相关文章