| 225 | } |
| 226 | |
| 227 | void Coordinator::InitFragmentStats() { |
| 228 | const TPlanFragment* coord_fragment = exec_params_.GetCoordFragment(); |
| 229 | int64_t total_num_finstances = 0; |
| 230 | |
| 231 | DCHECK_GT(exec_params_.num_fragments(), 0); |
| 232 | for (const TPlanFragment* fragment : exec_params_.GetFragments()) { |
| 233 | string root_profile_name = |
| 234 | Substitute( |
| 235 | fragment == coord_fragment ? "Coordinator Fragment $0" : "Fragment $0", |
| 236 | fragment->display_name); |
| 237 | const string& agg_profile_name = FLAGS_gen_experimental_profile ? |
| 238 | root_profile_name : |
| 239 | Substitute("Averaged Fragment $0", fragment->display_name); |
| 240 | int num_instances = exec_params_.query_schedule() |
| 241 | .fragment_exec_params(fragment->idx) |
| 242 | .instances_size(); |
| 243 | total_num_finstances += num_instances; |
| 244 | // TODO: special-case the coordinator fragment? |
| 245 | FragmentStats* fragment_stats = obj_pool()->Add(new FragmentStats( |
| 246 | agg_profile_name, root_profile_name, num_instances, obj_pool())); |
| 247 | fragment_stats_.push_back(fragment_stats); |
| 248 | query_profile_->AddChild(fragment_stats->agg_profile(), true); |
| 249 | if (!FLAGS_gen_experimental_profile) { |
| 250 | // Per-instance profiles are not included in the profile tree in profile V2. |
| 251 | query_profile_->AddChild(fragment_stats->root_profile()); |
| 252 | } |
| 253 | } |
| 254 | COUNTER_SET(PROFILE_NumFragments.Instantiate(query_profile_), |
| 255 | static_cast<int64_t>(exec_params_.num_fragments())); |
| 256 | COUNTER_SET(PROFILE_NumFragmentInstances.Instantiate(query_profile_), |
| 257 | total_num_finstances); |
| 258 | } |
| 259 | |
| 260 | void Coordinator::InitBackendStates() { |
| 261 | int num_backends = exec_params_.query_schedule().backend_exec_params().size(); |
nothing calls this directly
no test coverage detected