| 1369 | } |
| 1370 | |
| 1371 | int64_t Coordinator::GetMaxBackendStateLagMs(NetworkAddressPB* address) { |
| 1372 | DCHECK(exec_rpcs_complete_.Load()) << "Exec() must be called first."; |
| 1373 | DCHECK_GT(backend_states_.size(), 0); |
| 1374 | int64_t current_time = BackendState::GenerateReportTimestamp(); |
| 1375 | int64_t min_last_report_time_ms = current_time; |
| 1376 | BackendState* min_state = nullptr; |
| 1377 | for (BackendState* backend_state : backend_states_) { |
| 1378 | if (backend_state->IsDone()) continue; |
| 1379 | int64_t last_report_time_ms = backend_state->last_report_time_ms(); |
| 1380 | DCHECK_GT(last_report_time_ms, 0); |
| 1381 | if (last_report_time_ms < min_last_report_time_ms) { |
| 1382 | min_last_report_time_ms = last_report_time_ms; |
| 1383 | min_state = backend_state; |
| 1384 | } |
| 1385 | } |
| 1386 | if (min_state == nullptr) return 0; |
| 1387 | *address = min_state->krpc_impalad_address(); |
| 1388 | return current_time - min_last_report_time_ms; |
| 1389 | } |
| 1390 | |
| 1391 | // TODO: add histogram/percentile |
| 1392 | void Coordinator::ComputeQuerySummary() { |
no test coverage detected