| 2198 | } |
| 2199 | |
| 2200 | void ClientRequestState::UpdateEndTime() { |
| 2201 | // Update the query's end time only if it isn't set previously. |
| 2202 | if (end_time_us_.CompareAndSwap(0, UnixMicros())) { |
| 2203 | // Certain API clients expect Start Time and End Time to be date-time strings |
| 2204 | // of nanosecond precision, so we explicitly specify the precision here. |
| 2205 | summary_profile_->AddInfoString( |
| 2206 | "End Time", ToStringFromUnixMicros(end_time_us(), TimePrecision::Nanosecond)); |
| 2207 | int64_t duration = end_time_us() - start_time_us(); |
| 2208 | summary_profile_->AddInfoString("Duration", Substitute("$0 ($1 us)", |
| 2209 | PrettyPrinter::Print(duration, TUnit::TIME_US), duration)); |
| 2210 | } |
| 2211 | } |
| 2212 | |
| 2213 | int64_t ClientRequestState::GetTransactionId() const { |
| 2214 | DCHECK(InTransaction()); |
no test coverage detected