use of com.yammer.metrics.stats.Snapshot in project netty by netty.
the class CustomReporter method processTimer.
@Override
public void processTimer(final MetricName name, final Timer timer, final 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);
}
use of com.yammer.metrics.stats.Snapshot in project pinot by linkedin.
the class AggregatedHistogram method refresh.
/**
* update all stats using underlying histograms
*/
public void refresh() {
List<Double> values = new ArrayList<Double>();
_min = Double.MAX_VALUE;
_max = Double.MIN_VALUE;
_sum = 0;
double meanSum = 0.0;
for (T hist : _histograms) {
if (hist instanceof Histogram) {
Histogram h = (Histogram) hist;
_min = Math.min(_min, h.min());
_max = Math.max(_max, h.max());
_sum += h.sum();
meanSum += h.mean();
} else {
AggregatedHistogram<Sampling> h = (AggregatedHistogram<Sampling>) hist;
_min = Math.min(_min, h.min());
_max = Math.max(_max, h.max());
_sum += h.sum();
meanSum += h.mean();
}
double[] val = hist.getSnapshot().getValues();
for (double d : val) {
values.add(d);
}
}
if (!_histograms.isEmpty()) {
_mean = meanSum / _histograms.size();
}
if (!values.isEmpty()) {
double[] vals = new double[values.size()];
int i = 0;
for (Double d : values) {
vals[i++] = d;
}
_snapshot = new Snapshot(vals);
}
}
use of com.yammer.metrics.stats.Snapshot in project netty by netty.
the class CustomReporter method processHistogram.
@Override
public void processHistogram(final MetricName name, final Histogram histogram, final PrintStream stream) {
final Snapshot snapshot = histogram.getSnapshot();
stream.printf(locale, " min = %,2.2f\n", histogram.min());
stream.printf(locale, " max = %,2.2f\n", histogram.max());
stream.printf(locale, " mean = %,2.2f\n", histogram.mean());
stream.printf(locale, " stddev = %,2.2f\n", histogram.stdDev());
stream.printf(locale, " median = %,2.2f\n", snapshot.getMedian());
stream.printf(locale, " 75%% <= %,2.2f\n", snapshot.get75thPercentile());
stream.printf(locale, " 95%% <= %,2.2f\n", snapshot.get95thPercentile());
stream.printf(locale, " 98%% <= %,2.2f\n", snapshot.get98thPercentile());
stream.printf(locale, " 99%% <= %,2.2f\n", snapshot.get99thPercentile());
stream.printf(locale, " 99.9%% <= %,2.2f\n", snapshot.get999thPercentile());
}
use of com.yammer.metrics.stats.Snapshot in project platformlayer by platformlayer.
the class PlatformlayerMetricsReporter method sendSampling.
protected void sendSampling(MetricTreeObject subtree, Sampling metric) throws IOException {
final Snapshot snapshot = metric.getSnapshot();
subtree.addFloat("median", snapshot.getMedian());
subtree.addFloat("75percentile", snapshot.get75thPercentile());
subtree.addFloat("95percentile", snapshot.get95thPercentile());
subtree.addFloat("98percentile", snapshot.get98thPercentile());
subtree.addFloat("99percentile", snapshot.get99thPercentile());
subtree.addFloat("999percentile", snapshot.get999thPercentile());
}
Aggregations