MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / execute

Method execute

src/tsd/GraphHandler.java:380–405  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

378 }
379
380 private void execute() throws IOException {
381 final int nplotted = runGnuplot(query, basepath, plot);
382 if (query.hasQueryStringParam("json")) {
383 final HashMap<String, Object> results = new HashMap<String, Object>();
384 results.put("plotted", nplotted);
385 results.put("points", npoints);
386 // 1.0 returned an empty inner array if the 1st hashset was null, to do
387 // the same we need to fudge it with an empty set
388 if (aggregated_tags != null && aggregated_tags.length > 0 &&
389 aggregated_tags[0] == null) {
390 aggregated_tags[0] = new HashSet<String>();
391 }
392 results.put("etags", aggregated_tags);
393 results.put("timing", query.processingTimeMillis());
394 query.sendReply(JSON.serializeToBytes(results));
395 writeFile(query, basepath + ".json", JSON.serializeToBytes(results));
396 } else if (query.hasQueryStringParam("png")) {
397 query.sendFile(basepath + ".png", max_age);
398 } else {
399 query.internalError(new Exception("Should never be here!"));
400 }
401
402 // TODO(tsuna): Expire old files from the on-disk cache.
403 graphlatency.add(query.processingTimeMillis());
404 graphs_generated.incrementAndGet();
405 }
406
407 }
408

Callers 1

runMethod · 0.95

Calls 10

serializeToBytesMethod · 0.95
runGnuplotMethod · 0.80
putMethod · 0.80
processingTimeMillisMethod · 0.80
sendReplyMethod · 0.80
writeFileMethod · 0.80
sendFileMethod · 0.80
hasQueryStringParamMethod · 0.45
internalErrorMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected