DropwizardTransformer.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:dropwizard-influxdb-reporter 作者:
/**
 * Build an {@link InfluxDbMeasurement} from a histogram.
 */
@VisibleForTesting InfluxDbMeasurement fromHistogram(final String metricName, final Histogram h, final long timestamp) {
  final Snapshot snapshot = h.getSnapshot();
  final DropwizardMeasurement measurement = parser.parse(metricName);

  final Map<String, String> tags = new HashMap<>(baseTags);
  tags.putAll(measurement.tags());

  return new InfluxDbMeasurement.Builder(measurement.name(), timestamp)
    .putTags(tags)
    .putField("count", snapshot.size())
    .putField("min", snapshot.getMin())
    .putField("max", snapshot.getMax())
    .putField("mean", snapshot.getMean())
    .putField("std-dev", snapshot.getStdDev())
    .putField("50-percentile", snapshot.getMedian())
    .putField("75-percentile", snapshot.get75thPercentile())
    .putField("95-percentile", snapshot.get95thPercentile())
    .putField("99-percentile", snapshot.get99thPercentile())
    .putField("999-percentile", snapshot.get999thPercentile())
    .putField("run-count", h.getCount())
    .build();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号