Returns duration of the query is waiting in the queue.
| 421 | |
| 422 | /// Returns duration of the query is waiting in the queue. |
| 423 | int64_t wait_time_ms() const { |
| 424 | // wait_start_time_ms_ is zero iff the query is not require queuing. |
| 425 | if (wait_start_time_ms_ == 0) return 0; |
| 426 | // wait_end_time_ms_ might still be zero if the query is not yet dequeue. |
| 427 | // Use the current Unix time in that case. Note that the duration can be |
| 428 | // negative if a system clock reset happened after the query was initiated. |
| 429 | int64_t wait_end_time_ms = wait_end_time_ms_ > 0LL ? |
| 430 | wait_end_time_ms_ : MonotonicMillis(); |
| 431 | return wait_end_time_ms - wait_start_time_ms_; |
| 432 | } |
| 433 | |
| 434 | /// Returns the time taken for the client to fetch all rows. |
| 435 | int64_t client_fetch_wait_time_ns() const { |