| 620 | } |
| 621 | |
| 622 | Status Coordinator::FinishBackendStartup() { |
| 623 | DCHECK(exec_rpcs_complete_.Load()); |
| 624 | const TMetricDef& def = |
| 625 | MakeTMetricDef("backend-startup-latencies", TMetricKind::HISTOGRAM, TUnit::TIME_MS); |
| 626 | // Capture up to 30 minutes of start-up times, in ms, with 4 s.f. accuracy. |
| 627 | HistogramMetric latencies(def, 30 * 60 * 1000, 4); |
| 628 | Status status = Status::OK(); |
| 629 | string error_hostname; |
| 630 | string max_latency_host; |
| 631 | int max_latency = 0; |
| 632 | for (BackendState* backend_state: backend_states_) { |
| 633 | // All of the Exec() rpcs must have completed successfully. |
| 634 | DCHECK(backend_state->exec_rpc_status().ok()); |
| 635 | // preserve the first non-OK, if there is one |
| 636 | Status backend_status = backend_state->GetStatus(); |
| 637 | if (!backend_status.ok() && status.ok()) { |
| 638 | status = backend_status; |
| 639 | error_hostname = backend_state->impalad_address().hostname(); |
| 640 | } |
| 641 | if (backend_state->rpc_latency() > max_latency) { |
| 642 | // Find the backend that takes the most time to acknowledge to |
| 643 | // the ExecQueryFInstances() RPC. |
| 644 | max_latency = backend_state->rpc_latency(); |
| 645 | max_latency_host = NetworkAddressPBToString(backend_state->impalad_address()); |
| 646 | } |
| 647 | latencies.Update(backend_state->rpc_latency()); |
| 648 | // Mark backend complete if no fragment instances were assigned to it. |
| 649 | if (backend_state->IsEmptyBackend()) { |
| 650 | backend_exec_complete_barrier_->Notify(); |
| 651 | num_completed_backends_->Add(1); |
| 652 | } |
| 653 | } |
| 654 | query_profile_->AddInfoString( |
| 655 | "Backend startup latencies", latencies.ToHumanReadable()); |
| 656 | query_profile_->AddInfoString("Slowest backend to start up", max_latency_host); |
| 657 | return UpdateExecState(status, nullptr, error_hostname); |
| 658 | } |
| 659 | |
| 660 | string Coordinator::FilterDebugString() { |
| 661 | TablePrinter table_printer; |
nothing calls this directly
no test coverage detected