Java Code Examples for org.apache.flink.metrics.Histogram#getStatistics()
The following examples show how to use
org.apache.flink.metrics.Histogram#getStatistics() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StatsDReporter.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
private void reportHistogram(final String name, final Histogram histogram) { if (histogram != null) { HistogramStatistics statistics = histogram.getStatistics(); if (statistics != null) { send(prefix(name, "count"), String.valueOf(histogram.getCount())); send(prefix(name, "max"), String.valueOf(statistics.getMax())); send(prefix(name, "min"), String.valueOf(statistics.getMin())); send(prefix(name, "mean"), String.valueOf(statistics.getMean())); send(prefix(name, "stddev"), String.valueOf(statistics.getStdDev())); send(prefix(name, "p50"), String.valueOf(statistics.getQuantile(0.5))); send(prefix(name, "p75"), String.valueOf(statistics.getQuantile(0.75))); send(prefix(name, "p95"), String.valueOf(statistics.getQuantile(0.95))); send(prefix(name, "p98"), String.valueOf(statistics.getQuantile(0.98))); send(prefix(name, "p99"), String.valueOf(statistics.getQuantile(0.99))); send(prefix(name, "p999"), String.valueOf(statistics.getQuantile(0.999))); } } }
Example 2
Source File: MetricMapper.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
static Point map(MeasurementInfo info, Instant timestamp, Histogram histogram) { HistogramStatistics statistics = histogram.getStatistics(); return builder(info, timestamp) .addField("count", statistics.size()) .addField("min", statistics.getMin()) .addField("max", statistics.getMax()) .addField("mean", statistics.getMean()) .addField("stddev", statistics.getStdDev()) .addField("p50", statistics.getQuantile(.50)) .addField("p75", statistics.getQuantile(.75)) .addField("p95", statistics.getQuantile(.95)) .addField("p98", statistics.getQuantile(.98)) .addField("p99", statistics.getQuantile(.99)) .addField("p999", statistics.getQuantile(.999)) .build(); }
Example 3
Source File: StatsDReporter.java From flink with Apache License 2.0 | 6 votes |
private void reportHistogram(final String name, final Histogram histogram) { if (histogram != null) { HistogramStatistics statistics = histogram.getStatistics(); if (statistics != null) { send(prefix(name, "count"), histogram.getCount()); send(prefix(name, "max"), statistics.getMax()); send(prefix(name, "min"), statistics.getMin()); send(prefix(name, "mean"), statistics.getMean()); send(prefix(name, "stddev"), statistics.getStdDev()); send(prefix(name, "p50"), statistics.getQuantile(0.5)); send(prefix(name, "p75"), statistics.getQuantile(0.75)); send(prefix(name, "p95"), statistics.getQuantile(0.95)); send(prefix(name, "p98"), statistics.getQuantile(0.98)); send(prefix(name, "p99"), statistics.getQuantile(0.99)); send(prefix(name, "p999"), statistics.getQuantile(0.999)); } } }
Example 4
Source File: MetricMapper.java From flink with Apache License 2.0 | 6 votes |
static Point map(MeasurementInfo info, Instant timestamp, Histogram histogram) { HistogramStatistics statistics = histogram.getStatistics(); return builder(info, timestamp) .addField("count", statistics.size()) .addField("min", statistics.getMin()) .addField("max", statistics.getMax()) .addField("mean", statistics.getMean()) .addField("stddev", statistics.getStdDev()) .addField("p50", statistics.getQuantile(.50)) .addField("p75", statistics.getQuantile(.75)) .addField("p95", statistics.getQuantile(.95)) .addField("p98", statistics.getQuantile(.98)) .addField("p99", statistics.getQuantile(.99)) .addField("p999", statistics.getQuantile(.999)) .build(); }
Example 5
Source File: StatsDReporter.java From flink with Apache License 2.0 | 6 votes |
private void reportHistogram(final String name, final Histogram histogram) { if (histogram != null) { HistogramStatistics statistics = histogram.getStatistics(); if (statistics != null) { send(prefix(name, "count"), histogram.getCount()); send(prefix(name, "max"), statistics.getMax()); send(prefix(name, "min"), statistics.getMin()); send(prefix(name, "mean"), statistics.getMean()); send(prefix(name, "stddev"), statistics.getStdDev()); send(prefix(name, "p50"), statistics.getQuantile(0.5)); send(prefix(name, "p75"), statistics.getQuantile(0.75)); send(prefix(name, "p95"), statistics.getQuantile(0.95)); send(prefix(name, "p98"), statistics.getQuantile(0.98)); send(prefix(name, "p99"), statistics.getQuantile(0.99)); send(prefix(name, "p999"), statistics.getQuantile(0.999)); } } }
Example 6
Source File: MetricMapper.java From flink with Apache License 2.0 | 6 votes |
static Point map(MeasurementInfo info, Instant timestamp, Histogram histogram) { HistogramStatistics statistics = histogram.getStatistics(); return builder(info, timestamp) .addField("count", statistics.size()) .addField("min", statistics.getMin()) .addField("max", statistics.getMax()) .addField("mean", statistics.getMean()) .addField("stddev", statistics.getStdDev()) .addField("p50", statistics.getQuantile(.50)) .addField("p75", statistics.getQuantile(.75)) .addField("p95", statistics.getQuantile(.95)) .addField("p98", statistics.getQuantile(.98)) .addField("p99", statistics.getQuantile(.99)) .addField("p999", statistics.getQuantile(.999)) .build(); }
Example 7
Source File: MetricDumpSerialization.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
private static void serializeHistogram(DataOutput out, QueryScopeInfo info, String name, Histogram histogram) throws IOException { HistogramStatistics stat = histogram.getStatistics(); long min = stat.getMin(); long max = stat.getMax(); double mean = stat.getMean(); double median = stat.getQuantile(0.5); double stddev = stat.getStdDev(); double p75 = stat.getQuantile(0.75); double p90 = stat.getQuantile(0.90); double p95 = stat.getQuantile(0.95); double p98 = stat.getQuantile(0.98); double p99 = stat.getQuantile(0.99); double p999 = stat.getQuantile(0.999); serializeMetricInfo(out, info); out.writeUTF(name); out.writeLong(min); out.writeLong(max); out.writeDouble(mean); out.writeDouble(median); out.writeDouble(stddev); out.writeDouble(p75); out.writeDouble(p90); out.writeDouble(p95); out.writeDouble(p98); out.writeDouble(p99); out.writeDouble(p999); }
Example 8
Source File: MetricDumpSerialization.java From flink with Apache License 2.0 | 5 votes |
private static void serializeHistogram(DataOutput out, QueryScopeInfo info, String name, Histogram histogram) throws IOException { HistogramStatistics stat = histogram.getStatistics(); long min = stat.getMin(); long max = stat.getMax(); double mean = stat.getMean(); double median = stat.getQuantile(0.5); double stddev = stat.getStdDev(); double p75 = stat.getQuantile(0.75); double p90 = stat.getQuantile(0.90); double p95 = stat.getQuantile(0.95); double p98 = stat.getQuantile(0.98); double p99 = stat.getQuantile(0.99); double p999 = stat.getQuantile(0.999); serializeMetricInfo(out, info); out.writeUTF(name); out.writeLong(min); out.writeLong(max); out.writeDouble(mean); out.writeDouble(median); out.writeDouble(stddev); out.writeDouble(p75); out.writeDouble(p90); out.writeDouble(p95); out.writeDouble(p98); out.writeDouble(p99); out.writeDouble(p999); }
Example 9
Source File: MetricDumpSerialization.java From flink with Apache License 2.0 | 5 votes |
private static void serializeHistogram(DataOutput out, QueryScopeInfo info, String name, Histogram histogram) throws IOException { HistogramStatistics stat = histogram.getStatistics(); long min = stat.getMin(); long max = stat.getMax(); double mean = stat.getMean(); double median = stat.getQuantile(0.5); double stddev = stat.getStdDev(); double p75 = stat.getQuantile(0.75); double p90 = stat.getQuantile(0.90); double p95 = stat.getQuantile(0.95); double p98 = stat.getQuantile(0.98); double p99 = stat.getQuantile(0.99); double p999 = stat.getQuantile(0.999); serializeMetricInfo(out, info); out.writeUTF(name); out.writeLong(min); out.writeLong(max); out.writeDouble(mean); out.writeDouble(median); out.writeDouble(stddev); out.writeDouble(p75); out.writeDouble(p90); out.writeDouble(p95); out.writeDouble(p98); out.writeDouble(p99); out.writeDouble(p999); }
Example 10
Source File: AbstractPrometheusReporter.java From flink with Apache License 2.0 | 5 votes |
private void addSamples(final List<String> labelValues, final Histogram histogram, final List<MetricFamilySamples.Sample> samples) { samples.add(new MetricFamilySamples.Sample(metricName + "_count", labelNamesWithQuantile.subList(0, labelNamesWithQuantile.size() - 1), labelValues, histogram.getCount())); final HistogramStatistics statistics = histogram.getStatistics(); for (final Double quantile : QUANTILES) { samples.add(new MetricFamilySamples.Sample(metricName, labelNamesWithQuantile, addToList(labelValues, quantile.toString()), statistics.getQuantile(quantile))); } }