本文整理了Java中org.apache.flink.metrics.Histogram.getCount()
方法的一些代码示例,展示了Histogram.getCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.getCount()
方法的具体详情如下:
包路径:org.apache.flink.metrics.Histogram
类名称:Histogram
方法名:getCount
[英]Get the count of seen elements.
[中]获取已看到元素的计数。
代码示例来源:origin: apache/flink
@Override
public long getCount() {
return histogram.getCount();
}
代码示例来源:origin: apache/flink
@Override
public long getCount() {
return histogram.getCount();
}
代码示例来源:origin: apache/flink
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()));
for (final Double quantile : QUANTILES) {
samples.add(new MetricFamilySamples.Sample(metricName, labelNamesWithQuantile,
addToList(labelValues, quantile.toString()),
histogram.getStatistics().getQuantile(quantile)));
}
}
}
代码示例来源:origin: apache/flink
@Test
public void testLatencyStatsOperator() {
testLatencyStats(LatencyStats.Granularity.OPERATOR, registrations -> {
Assert.assertEquals(2, registrations.size());
{
final Tuple2<String, Histogram> registration = registrations.get(0);
assertName(registration.f0, SOURCE_ID_1);
Assert.assertEquals(3, registration.f1.getCount());
}
{
final Tuple2<String, Histogram> registration = registrations.get(1);
assertName(registration.f0, SOURCE_ID_2);
Assert.assertEquals(2, registration.f1.getCount());
}
});
}
代码示例来源:origin: apache/flink
@Test
public void testLatencyStatsSingle() {
testLatencyStats(LatencyStats.Granularity.SINGLE, registrations -> {
Assert.assertEquals(1, registrations.size());
{
final Tuple2<String, Histogram> registration = registrations.get(0);
assertName(registration.f0);
Assert.assertEquals(5, registration.f1.getCount());
}
});
}
代码示例来源:origin: apache/flink
@Test
public void testLatencyStatsSubtask() {
testLatencyStats(LatencyStats.Granularity.SUBTASK, registrations -> {
Assert.assertEquals(4, registrations.size());
{
final Tuple2<String, Histogram> registration = registrations.get(0);
assertName(registration.f0, SOURCE_ID_1, 0);
Assert.assertEquals(2, registration.f1.getCount());
}
{
final Tuple2<String, Histogram> registration = registrations.get(1);
assertName(registration.f0, SOURCE_ID_1, 1);
Assert.assertEquals(1, registration.f1.getCount());
}
{
final Tuple2<String, Histogram> registration = registrations.get(2);
assertName(registration.f0, SOURCE_ID_2, 2);
Assert.assertEquals(1, registration.f1.getCount());
}
{
final Tuple2<String, Histogram> registration = registrations.get(3);
assertName(registration.f0, SOURCE_ID_2, 3);
Assert.assertEquals(1, registration.f1.getCount());
}
});
}
代码示例来源:origin: apache/flink
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)));
}
}
}
代码示例来源:origin: com.alibaba.blink/flink-metrics-dropwizard
@Override
public long getCount() {
return histogram.getCount();
}
代码示例来源:origin: org.apache.flink/flink-metrics-jmx
@Override
public long getCount() {
return histogram.getCount();
}
内容来源于网络,如有侵权,请联系作者删除!