public abstract class AbstractMetricsHandler extends AbstractJsonRequestHandler
[ { "id" : "X" } ]
If the query parameters do contain a "get" parameter a comma-separate list of metric names is expected as a value.
/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" } ]
Constructor and Description |
---|
AbstractMetricsHandler(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.
|
String |
handleJsonRequest(Map<String,String> pathParams,
Map<String,String> queryParams,
ActorGateway jobManager)
Core method that handles the request and generates the response.
|
handleRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPaths
public AbstractMetricsHandler(MetricFetcher fetcher)
public String handleJsonRequest(Map<String,String> pathParams, Map<String,String> queryParams, ActorGateway jobManager) throws Exception
AbstractJsonRequestHandler
handleJsonRequest
in class AbstractJsonRequestHandler
pathParams
- The map of REST path parameters, decoded by the router.queryParams
- The map of query parameters.jobManager
- The JobManager actor.Exception
- Handlers may forward exceptions. Exceptions of type
NotFoundException
will cause a HTTP 404
response with the exception message, other exceptions will cause a HTTP 500 response
with the exception stack trace.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.