@Internal public class MetricUtil extends Object
| 构造器和说明 |
|---|
MetricUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.apache.kafka.common.Metric |
getKafkaMetric(Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> metrics,
java.util.function.Predicate<Map.Entry<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric>> filter)
Tries to find the Kafka
Metric in the provided metrics matching a given filter. |
static org.apache.kafka.common.Metric |
getKafkaMetric(Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> metrics,
String metricGroup,
String metricName)
Tries to find the Kafka
Metric in the provided metrics. |
static void |
sync(org.apache.kafka.common.Metric from,
org.apache.flink.metrics.Counter to)
Ensures that the counter has the same value as the given Kafka metric.
|
public static org.apache.kafka.common.Metric getKafkaMetric(Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> metrics, String metricGroup, String metricName)
Metric in the provided metrics.Metric which exposes continuous updatesIllegalStateException - if the metric is not part of the provided metricspublic static org.apache.kafka.common.Metric getKafkaMetric(Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> metrics, java.util.function.Predicate<Map.Entry<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric>> filter)
Metric in the provided metrics matching a given filter.Metric which exposes continuous updatesIllegalStateException - if no metric matches the given filterpublic static void sync(org.apache.kafka.common.Metric from,
org.apache.flink.metrics.Counter to)
Do not use this method for every record because Metric.metricValue() is an
expensive operation.
from - Kafka's Metric to queryto - Counter to write the value toCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.