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 calling removeMetric(Metric) - a metric dump request by calling queryMetrics(Duration)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.runtime.rpc.RpcEndpoint
org.apache.flink.runtime.rpc.RpcEndpoint.MainThreadExecutor -
Field Summary
FieldsFields inherited from class org.apache.flink.runtime.rpc.RpcEndpoint
log, rpcServer -
Constructor Summary
ConstructorsConstructorDescriptionMetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, String endpointId, long messageSizeLimit) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetric(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.onStop()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, validateRunsInMainThreadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.util.AutoCloseableAsync
closeMethods inherited from interface org.apache.flink.runtime.rpc.RpcGateway
getAddress, getHostname
-
Field Details
-
METRIC_QUERY_SERVICE_NAME
- See Also:
-
-
Constructor Details
-
MetricQueryService
public MetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, String endpointId, long messageSizeLimit)
-
-
Method Details
-
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
-