code: public void addStat(final int query_index, final QueryStat name, 
        final long value) {
      Map<QueryStat, Long> qs = query_stats.get(query_index);
      if (qs == null) {
        qs = new HashMap<QueryStat, Long>();
        query_stats.put(query_index, qs);
      }
      qs.put(name, value);
    }
docs: Adds a stat for a sub query, replacing it if it exists. Times must be
  in nanoseconds.
  @param query_index The index of the sub query to update
  @param name The name of the stat to update
  @param value The value to set