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

Method updateStat

src/stats/QueryStats.java:589–602  ·  view source on GitHub ↗

Increments the cumulative value for a cumulative stat. If it's a time then it must be in nanoseconds @param query_index The index of the sub query @param name The name of the stat @param value The value to add to the existing value

(final int query_index, final QueryStat name, 
      final long value)

Source from the content-addressed store, hash-verified

587 * @param value The value to add to the existing value
588 */
589 public void updateStat(final int query_index, final QueryStat name,
590 final long value) {
591 Map<QueryStat, Long> qs = query_stats.get(query_index);
592 long cum_time = value;
593 if (qs == null) {
594 qs = new HashMap<QueryStat, Long>();
595 query_stats.put(query_index, qs);
596 }
597
598 if (qs.containsKey(name)) {
599 cum_time += qs.get(name);
600 }
601 qs.put(name, cum_time);
602 }
603
604 /**
605 * Adds a value for a specific scanner for a specific sub query. If it's a time

Callers 1

aggQueryStatsMethod · 0.95

Calls 2

putMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected