Class MetricQueryService
- java.lang.Object
-
- org.apache.flink.runtime.rpc.RpcEndpoint
-
- org.apache.flink.runtime.metrics.dump.MetricQueryService
-
- All Implemented Interfaces:
AutoCloseable,org.apache.flink.runtime.rpc.RpcGateway,MetricQueryServiceGateway,org.apache.flink.util.AutoCloseableAsync
public class MetricQueryService extends org.apache.flink.runtime.rpc.RpcEndpoint implements MetricQueryServiceGateway
The MetricQueryService creates a key-value representation of all metrics currently registered with Flink when queried.It is realized as an actor and can be notified of - an added metric by calling
addMetric(String, Metric, AbstractMetricGroup)- a removed metric by callingremoveMetric(Metric)- a metric dump request by callingqueryMetrics(Duration)
-
-
Field Summary
Fields Modifier and Type Field Description static StringMETRIC_QUERY_SERVICE_NAME
-
Constructor Summary
Constructors Constructor Description MetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, String endpointId, long messageSizeLimit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMetric(String metricName, org.apache.flink.metrics.Metric metric, AbstractMetricGroup group)static MetricQueryServicecreateMetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, ResourceID resourceID, long maximumFrameSize)Starts the MetricQueryService actor in the given actor system.CompletableFuture<Void>onStop()CompletableFuture<MetricDumpSerialization.MetricSerializationResult>queryMetrics(Duration timeout)voidremoveMetric(org.apache.flink.metrics.Metric metric)-
Methods inherited from class org.apache.flink.runtime.rpc.RpcEndpoint
callAsync, closeAsync, getAddress, getEndpointId, getHostname, getMainThreadExecutor, getMainThreadExecutor, getRpcService, getSelfGateway, getTerminationFuture, internalCallOnStart, internalCallOnStop, isRunning, onStart, registerResource, runAsync, scheduleRunAsync, scheduleRunAsync, start, stop, unregisterResource, validateRunsInMainThread
-
-
-
-
Field Detail
-
METRIC_QUERY_SERVICE_NAME
public static final String METRIC_QUERY_SERVICE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MetricQueryService
public MetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, String endpointId, long messageSizeLimit)
-
-
Method Detail
-
onStop
public CompletableFuture<Void> onStop()
- Overrides:
onStopin classorg.apache.flink.runtime.rpc.RpcEndpoint
-
addMetric
public void addMetric(String metricName, org.apache.flink.metrics.Metric metric, AbstractMetricGroup group)
-
removeMetric
public void removeMetric(org.apache.flink.metrics.Metric metric)
-
queryMetrics
public CompletableFuture<MetricDumpSerialization.MetricSerializationResult> queryMetrics(Duration timeout)
- Specified by:
queryMetricsin interfaceMetricQueryServiceGateway
-
createMetricQueryService
public static MetricQueryService createMetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, ResourceID resourceID, long maximumFrameSize)
Starts the MetricQueryService actor in the given actor system.- Parameters:
rpcService- The rpcService running the MetricQueryServiceresourceID- resource ID to disambiguate the actor name- Returns:
- actor reference to the MetricQueryService
-
-