public abstract class AbstractMetricsHandler extends AbstractJsonRequestHandler
If the query parameters do not contain a "get" parameter the list of all metrics is returned.
[ { "id" : "X" } ]
If the query parameters do contain a "get" parameter, a comma-separated list of metric names is expected as a value.
/metrics?get=X,Y
The handler will then return a list containing the values of the requested metrics.
[ { "id" : "X", "value" : "S" }, { "id" : "Y", "value" : "T" } ]
| Modifier and Type | Field and Description |
|---|---|
static String |
PARAMETER_METRICS |
executor| Constructor and Description |
|---|
AbstractMetricsHandler(Executor executor,
MetricFetcher fetcher) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Map<String,String> |
getMapFor(Map<String,String> pathParams,
MetricStore metrics)
Returns a Map containing the metrics belonging to the entity pointed to by the path parameters.
|
CompletableFuture<String> |
handleJsonRequest(Map<String,String> pathParams,
Map<String,String> queryParams,
JobManagerGateway jobManagerGateway)
Core method that handles the request and generates the response.
|
handleRequestclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPathspublic static final String PARAMETER_METRICS
public AbstractMetricsHandler(Executor executor, MetricFetcher fetcher)
public CompletableFuture<String> handleJsonRequest(Map<String,String> pathParams, Map<String,String> queryParams, JobManagerGateway jobManagerGateway)
AbstractJsonRequestHandlerhandleJsonRequest in class AbstractJsonRequestHandlerpathParams - The map of REST path parameters, decoded by the router.queryParams - The map of query parameters.jobManagerGateway - to communicate with the JobManager.protected abstract Map<String,String> getMapFor(Map<String,String> pathParams, MetricStore metrics)
pathParams - REST path parametersmetrics - MetricStore containing all metricsCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.