sendResponse(ctx, request, "Too many metrics fetch in a single call. Max limit is " + maxMetricsPerRequest
+ ".", HttpResponseStatus.BAD_REQUEST);
return;
}
HTTPRequestWithDecodedQueryParams requestWithParams = (HTTPRequestWithDecodedQueryParams) request;
final Timer.Context httpBatchMetricsFetchTimerContext = httpBatchMetricsFetchTimer.time();
try {
RollupsQueryParams params = PlotRequestParser.parseParams(requestWithParams.getQueryParams());
BatchMetricsQuery query = new BatchMetricsQuery(locators, params.getRange(), params.getGranularity());
Map<Locator, MetricData> results = new BatchMetricsQueryHandler(executor, AstyanaxReader.getInstance())
.execute(query, queryTimeout);
JSONObject metrics = serializer.transformRollupData(results, params.getStats());
final JsonElement element = parser.parse(metrics.toString());