public void endQuery(long startTime, boolean timedOut, boolean failed) {
    long duration = getStatTime() - startTime;
    endClientOp(duration, timedOut, failed);
    stats.incInt(queryInProgressId, -1);
    int endQueryId;
    if (timedOut) {
      endQueryId = queryTimedOutId;
    } else if (failed) {
      endQueryId = queryFailedId;
    } else {
      endQueryId = queryId;
    }
    stats.incInt(endQueryId, 1);
    stats.incLong(queryDurationId, duration);
  }
Records that the specified query has ended

@param startTime the value returned by {@link #startQuery}.
@param timedOut true if query timed out
@param failed true if query failed
geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionStats.java