tsdbquery.setEndTime(end_time);
} catch (IllegalArgumentException e) {
throw new BadRequestException("end time: " + e.getMessage());
}
}
final Plot plot = new Plot(start_time, end_time,
DateTime.timezones.get(query.getQueryStringParam("tz")));
setPlotDimensions(query, plot);
setPlotParams(query, plot);
final int nqueries = tsdbqueries.length;
@SuppressWarnings("unchecked")
final HashSet<String>[] aggregated_tags = new HashSet[nqueries];
int npoints = 0;
for (int i = 0; i < nqueries; i++) {
try { // execute the TSDB query!
// XXX This is slow and will block Netty. TODO(tsuna): Don't block.
// TODO(tsuna): Optimization: run each query in parallel.
final DataPoints[] series = tsdbqueries[i].run();
for (final DataPoints datapoints : series) {
plot.add(datapoints, options.get(i));
aggregated_tags[i] = new HashSet<String>();
aggregated_tags[i].addAll(datapoints.getAggregatedTags());
npoints += datapoints.aggregatedSize();
}
} catch (RuntimeException e) {