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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.apache.flink.runtime.rpc.RpcEndpoint

    log, rpcServer
  • Constructor Summary

    Constructors
    Constructor
    Description
    MetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, String endpointId, long messageSizeLimit)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addMetric(String metricName, org.apache.flink.metrics.Metric metric, AbstractMetricGroup group)
     
    createMetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, ResourceID resourceID, long maximumFrameSize)
    Starts the MetricQueryService actor in the given actor system.
     
     
    void
    removeMetric(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.flink.util.AutoCloseableAsync

    close

    Methods inherited from interface org.apache.flink.runtime.rpc.RpcGateway

    getAddress, getHostname
  • Field Details

  • Constructor Details

    • MetricQueryService

      public MetricQueryService(org.apache.flink.runtime.rpc.RpcService rpcService, String endpointId, long messageSizeLimit)
  • Method Details

    • onStop

      public CompletableFuture<Void> onStop()
      Overrides:
      onStop in class org.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

      Specified by:
      queryMetrics in interface MetricQueryServiceGateway
    • 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 MetricQueryService
      resourceID - resource ID to disambiguate the actor name
      Returns:
      actor reference to the MetricQueryService