MCPcopy Create free account
hub / github.com/apache/impala / InitFragmentStats

Method InitFragmentStats

be/src/runtime/coordinator.cc:227–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void 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
260void Coordinator::InitBackendStates() {
261 int num_backends = exec_params_.query_schedule().backend_exec_params().size();

Callers

nothing calls this directly

Calls 9

SubstituteFunction · 0.85
GetCoordFragmentMethod · 0.80
num_fragmentsMethod · 0.80
push_backMethod · 0.80
AddChildMethod · 0.80
agg_profileMethod · 0.80
root_profileMethod · 0.80
AddMethod · 0.45
InstantiateMethod · 0.45

Tested by

no test coverage detected