Source:
<code>private static Query[] parseQuery(final TSDB tsdb, final HttpQuery query) { final List<String> ms = query.getQueryStringParams("m"); if (ms == null) { throw BadRequestException.missingParameter("m"); } final Query[] tsdbqueries = new Query[ms.size()]; int nqueries = 0; for (final String m : ms) { final String[] parts = Tags.splitString(m, ':'); int i = parts.length; if (i < 2 || i > 4) { throw new BadRequestException("Invalid parameter m=" + m + " (" + (i < 2 ? "not enough" : "too many") + " :-separated parts)"); } final Aggregator agg = getAggregator(parts[0]); i--; final HashMap<String, String> parsedtags = new HashMap<String, String>(); final String metric = Tags.parseWithMetric(parts[i], parsedtags); final boolean rate = parts[--i].startsWith("rate"); <START> final RateOptions rateOptions = parseRateOptions(rate, parts[i]); <END> if (rate) { i--; } final Query tsdbquery = tsdb.newQuery(); try { tsdbquery.setTimeSeries(metric, parsedtags, agg, rate, rateOptions); } catch (NoSuchUniqueName e) { throw new BadRequestException(e.getMessage()); } if (i > 0) { final int dash = parts[1].indexOf('-', 1); if (dash < 0) { throw new BadRequestException("Invalid downsampling specifier '" + parts[1] + "' in m=" + m); } Aggregator downsampler; try { downsampler = Aggregators.get(parts[1].substring(dash + 1)); } catch (NoSuchElementException e) { throw new BadRequestException("No such downsampling function: " + parts[1].substring(dash + 1)); } final int interval = parseDuration(parts[1].substring(0, dash)); tsdbquery.downsample(interval, downsampler); } tsdbqueries[nqueries++] = tsdbquery; } return tsdbqueries; }</code><technical_language>rate_options</technical_language>

Target:
private static Query[] parseQuery(final TSDB tsdb, final HttpQuery query) { final List<String> ms = query.getQueryStringParams("m"); if (ms == null) { throw BadRequestException.missingParameter("m"); } final Query[] tsdbqueries = new Query[ms.size()]; int nqueries = 0; for (final String m : ms) { final String[] parts = Tags.splitString(m, ':'); int i = parts.length; if (i < 2 || i > 4) { throw new BadRequestException("Invalid parameter m=" + m + " (" + (i < 2 ? "not enough" : "too many") + " :-separated parts)"); } final Aggregator agg = getAggregator(parts[0]); i--; final HashMap<String, String> parsedtags = new HashMap<String, String>(); final String metric = Tags.parseWithMetric(parts[i], parsedtags); final boolean rate = parts[--i].startsWith("rate"); final RateOptions rate_options = parseRateOptions(rate, parts[i]); if (rate) { i--; } final Query tsdbquery = tsdb.newQuery(); try { tsdbquery.setTimeSeries(metric, parsedtags, agg, rate, rate_options); } catch (NoSuchUniqueName e) { throw new BadRequestException(e.getMessage()); } if (i > 0) { final int dash = parts[1].indexOf('-', 1); if (dash < 0) { throw new BadRequestException("Invalid downsampling specifier '" + parts[1] + "' in m=" + m); } Aggregator downsampler; try { downsampler = Aggregators.get(parts[1].substring(dash + 1)); } catch (NoSuchElementException e) { throw new BadRequestException("No such downsampling function: " + parts[1].substring(dash + 1)); } final int interval = parseDuration(parts[1].substring(0, dash)); tsdbquery.downsample(interval, downsampler); } tsdbqueries[nqueries++] = tsdbquery; } return tsdbqueries; }