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

Method getGnuplotBasePath

src/tsd/GraphHandler.java:426–438  ·  view source on GitHub ↗

Returns the base path to use for the Gnuplot files.

(final TSDB tsdb, final HttpQuery query)

Source from the content-addressed store, hash-verified

424
425 /** Returns the base path to use for the Gnuplot files. */
426 private String getGnuplotBasePath(final TSDB tsdb, final HttpQuery query) {
427 final Map<String, List<String>> q = query.getQueryString();
428 q.remove("ignore");
429 // Super cheap caching mechanism: hash the query string.
430 final HashMap<String, List<String>> qs =
431 new HashMap<String, List<String>>(q);
432 // But first remove the parameters that don't influence the output.
433 qs.remove("png");
434 qs.remove("json");
435 qs.remove("ascii");
436 return tsdb.getConfig().getDirectoryName("tsd.http.cachedir") +
437 Integer.toHexString(qs.hashCode());
438 }
439
440 /**
441 * Checks whether or not it's possible to re-serve this query from disk.

Callers 1

doGraphMethod · 0.95

Calls 5

getDirectoryNameMethod · 0.80
removeMethod · 0.65
getQueryStringMethod · 0.45
getConfigMethod · 0.45
hashCodeMethod · 0.45

Tested by

no test coverage detected