Java Code Examples for org.apache.flink.runtime.metrics.dump.MetricDump#MeterDump

The following examples show how to use org.apache.flink.runtime.metrics.dump.MetricDump#MeterDump . 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: MetricStore.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private void addMetric(Map<String, String> target, String name, MetricDump metric) {
	switch (metric.getCategory()) {
		case METRIC_CATEGORY_COUNTER:
			MetricDump.CounterDump counter = (MetricDump.CounterDump) metric;
			target.put(name, String.valueOf(counter.count));
			break;
		case METRIC_CATEGORY_GAUGE:
			MetricDump.GaugeDump gauge = (MetricDump.GaugeDump) metric;
			target.put(name, gauge.value);
			break;
		case METRIC_CATEGORY_HISTOGRAM:
			MetricDump.HistogramDump histogram = (MetricDump.HistogramDump) metric;
			target.put(name + "_min", String.valueOf(histogram.min));
			target.put(name + "_max", String.valueOf(histogram.max));
			target.put(name + "_mean", String.valueOf(histogram.mean));
			target.put(name + "_median", String.valueOf(histogram.median));
			target.put(name + "_stddev", String.valueOf(histogram.stddev));
			target.put(name + "_p75", String.valueOf(histogram.p75));
			target.put(name + "_p90", String.valueOf(histogram.p90));
			target.put(name + "_p95", String.valueOf(histogram.p95));
			target.put(name + "_p98", String.valueOf(histogram.p98));
			target.put(name + "_p99", String.valueOf(histogram.p99));
			target.put(name + "_p999", String.valueOf(histogram.p999));
			break;
		case METRIC_CATEGORY_METER:
			MetricDump.MeterDump meter = (MetricDump.MeterDump) metric;
			target.put(name, String.valueOf(meter.rate));
			break;
	}
}
 
Example 2
Source File: MetricStore.java    From flink with Apache License 2.0 5 votes vote down vote up
private void addMetric(Map<String, String> target, String name, MetricDump metric) {
	switch (metric.getCategory()) {
		case METRIC_CATEGORY_COUNTER:
			MetricDump.CounterDump counter = (MetricDump.CounterDump) metric;
			target.put(name, String.valueOf(counter.count));
			break;
		case METRIC_CATEGORY_GAUGE:
			MetricDump.GaugeDump gauge = (MetricDump.GaugeDump) metric;
			target.put(name, gauge.value);
			break;
		case METRIC_CATEGORY_HISTOGRAM:
			MetricDump.HistogramDump histogram = (MetricDump.HistogramDump) metric;
			target.put(name + "_min", String.valueOf(histogram.min));
			target.put(name + "_max", String.valueOf(histogram.max));
			target.put(name + "_mean", String.valueOf(histogram.mean));
			target.put(name + "_median", String.valueOf(histogram.median));
			target.put(name + "_stddev", String.valueOf(histogram.stddev));
			target.put(name + "_p75", String.valueOf(histogram.p75));
			target.put(name + "_p90", String.valueOf(histogram.p90));
			target.put(name + "_p95", String.valueOf(histogram.p95));
			target.put(name + "_p98", String.valueOf(histogram.p98));
			target.put(name + "_p99", String.valueOf(histogram.p99));
			target.put(name + "_p999", String.valueOf(histogram.p999));
			break;
		case METRIC_CATEGORY_METER:
			MetricDump.MeterDump meter = (MetricDump.MeterDump) metric;
			target.put(name, String.valueOf(meter.rate));
			break;
	}
}
 
Example 3
Source File: MetricStore.java    From flink with Apache License 2.0 5 votes vote down vote up
private void addMetric(Map<String, String> target, String name, MetricDump metric) {
	switch (metric.getCategory()) {
		case METRIC_CATEGORY_COUNTER:
			MetricDump.CounterDump counter = (MetricDump.CounterDump) metric;
			target.put(name, String.valueOf(counter.count));
			break;
		case METRIC_CATEGORY_GAUGE:
			MetricDump.GaugeDump gauge = (MetricDump.GaugeDump) metric;
			target.put(name, gauge.value);
			break;
		case METRIC_CATEGORY_HISTOGRAM:
			MetricDump.HistogramDump histogram = (MetricDump.HistogramDump) metric;
			target.put(name + "_min", String.valueOf(histogram.min));
			target.put(name + "_max", String.valueOf(histogram.max));
			target.put(name + "_mean", String.valueOf(histogram.mean));
			target.put(name + "_median", String.valueOf(histogram.median));
			target.put(name + "_stddev", String.valueOf(histogram.stddev));
			target.put(name + "_p75", String.valueOf(histogram.p75));
			target.put(name + "_p90", String.valueOf(histogram.p90));
			target.put(name + "_p95", String.valueOf(histogram.p95));
			target.put(name + "_p98", String.valueOf(histogram.p98));
			target.put(name + "_p99", String.valueOf(histogram.p99));
			target.put(name + "_p999", String.valueOf(histogram.p999));
			break;
		case METRIC_CATEGORY_METER:
			MetricDump.MeterDump meter = (MetricDump.MeterDump) metric;
			target.put(name, String.valueOf(meter.rate));
			break;
	}
}