Source:
public void handle(ChannelHandlerContext ctx, FullHttpRequest request) { Tracker.getInstance().track(request); final String tenantId = request.headers().get("tenantId"); final String metricName = request.headers().get("metricName"); if (!(request instanceof HttpRequestWithDecodedQueryParams)) { DefaultHandler.sendErrorResponse(ctx, request, "Missing query params: from, to, points", HttpResponseStatus.BAD_REQUEST); return; } HttpRequestWithDecodedQueryParams requestWithParams = (HttpRequestWithDecodedQueryParams) request; final Timer.Context httpMetricsFetchTimerContext = httpMetricsFetchTimer.time(); try { RollupsQueryParams params = PlotRequestParser.parseParams(requestWithParams.getQueryParams()); JSONObject metricData; if (params.isGetByPoints()) { metricData = GetDataByPoints(tenantId, metricName, params.getRange().getStart(), params.getRange().getStop(), params.getPoints(), params.getStats()); } else if (params.isGetByResolution()) { metricData = GetDataByResolution(tenantId, metricName, params.getRange().getStart(), params.getRange().getStop(), params.getResolution(), params.getStats()); } else { throw new InvalidRequestException("Invalid rollups query. Neither points nor resolution specified."); } final JsonElement element = parser.parse(metricData.toString()); final String jsonStringRep = gson.toJson(element); sendResponse(ctx, request, jsonStringRep, HttpResponseStatus.OK); } catch (InvalidRequestException e) { log.warn(e.getMessage()); DefaultHandler.sendErrorResponse(ctx, request, e.getMessage(), HttpResponseStatus.BAD_REQUEST); } catch (SerializationException e) { log.error(e.getMessage(), e); DefaultHandler.sendErrorResponse(ctx, request, e.getMessage(), HttpResponseStatus.INTERNAL_SERVER_ERROR); } catch (Exception e) { log.error(e.getMessage(), e); DefaultHandler.sendErrorResponse(ctx, request, e.getMessage(), HttpResponseStatus.INTERNAL_SERVER_ERROR); } finally { httpMetricsFetchTimerContext.stop(); } }

Target:
public void handle(ChannelHandlerContext ctx, FullHttpRequest request) { Tracker.getInstance().track(request); final String tenantId = request.headers().get("tenantId"); final String metricName = request.headers().get("metricName"); if (!(request instanceof HttpRequestWithDecodedQueryParams)) { DefaultHandler.sendErrorResponse(ctx, request, "Missing query params: from, to, points", HttpResponseStatus.BAD_REQUEST); return; } HttpRequestWithDecodedQueryParams requestWithParams = (HttpRequestWithDecodedQueryParams) request; final Timer.Context httpMetricsFetchTimerContext = httpMetricsFetchTimer.time(); try { RollupsQueryParams params = PlotRequestParser.parseParams(requestWithParams.getQueryParams()); JSONObject metricData; if (params.isGetByPoints()) { metricData = GetDataByPoints(tenantId, metricName, params.getRange().getStart(), params.getRange().getStop(), params.getPoints(), params.getStats()); } else if (params.isGetByResolution()) { metricData = GetDataByResolution(tenantId, metricName, params.getRange().getStart(), params.getRange().getStop(), params.getResolution(), params.getStats()); } else { throw new InvalidRequestException("Invalid rollups query. Neither points nor resolution specified."); } final JsonElement element = parser.parse(metricData.toString()); final String jsonStringRep = gson.toJson(element); sendResponse(ctx, request, jsonStringRep, HttpResponseStatus.OK); } catch (InvalidRequestException e) { log.debug(e.getMessage()); DefaultHandler.sendErrorResponse(ctx, request, e.getMessage(), HttpResponseStatus.BAD_REQUEST); } catch (SerializationException e) { log.error(e.getMessage(), e); DefaultHandler.sendErrorResponse(ctx, request, e.getMessage(), HttpResponseStatus.INTERNAL_SERVER_ERROR); } catch (Exception e) { log.error(e.getMessage(), e); DefaultHandler.sendErrorResponse(ctx, request, e.getMessage(), HttpResponseStatus.INTERNAL_SERVER_ERROR); } finally { httpMetricsFetchTimerContext.stop(); } }