public class MetricQueryService extends RpcEndpoint implements MetricQueryServiceGateway
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(Time)
RpcEndpoint.MainThreadExecutor
Modifier and Type | Field and Description |
---|---|
static String |
METRIC_QUERY_SERVICE_NAME |
log, rpcServer
Constructor and Description |
---|
MetricQueryService(RpcService rpcService,
String endpointId,
long messageSizeLimit) |
Modifier and Type | Method and Description |
---|---|
void |
addMetric(String metricName,
Metric metric,
AbstractMetricGroup group) |
static MetricQueryService |
createMetricQueryService(RpcService rpcService,
ResourceID resourceID,
long maximumFrameSize)
Starts the MetricQueryService actor in the given actor system.
|
CompletableFuture<Void> |
onStop()
User overridable callback which is called from
RpcEndpoint.internalCallOnStop() . |
CompletableFuture<MetricDumpSerialization.MetricSerializationResult> |
queryMetrics(Time timeout) |
void |
removeMetric(Metric metric) |
callAsync, closeAsync, getAddress, getEndpointId, getHostname, getMainThreadExecutor, getRpcService, getSelfGateway, getTerminationFuture, internalCallOnStart, internalCallOnStop, isRunning, onStart, registerResource, runAsync, scheduleRunAsync, scheduleRunAsync, start, stop, unregisterResource, validateRunsInMainThread
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAddress, getHostname
close
public static final String METRIC_QUERY_SERVICE_NAME
public MetricQueryService(RpcService rpcService, String endpointId, long messageSizeLimit)
public CompletableFuture<Void> onStop()
RpcEndpoint
RpcEndpoint.internalCallOnStop()
.
This method is called when the RpcEndpoint is being shut down. The method is guaranteed to be executed in the main thread context and can be used to clean up internal state.
IMPORTANT: This method should never be called directly by the user.
onStop
in class RpcEndpoint
public void addMetric(String metricName, Metric metric, AbstractMetricGroup group)
public void removeMetric(Metric metric)
public CompletableFuture<MetricDumpSerialization.MetricSerializationResult> queryMetrics(Time timeout)
queryMetrics
in interface MetricQueryServiceGateway
public static MetricQueryService createMetricQueryService(RpcService rpcService, ResourceID resourceID, long maximumFrameSize)
rpcService
- The rpcService running the MetricQueryServiceresourceID
- resource ID to disambiguate the actor nameCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.