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

Method ToJson

be/src/runtime/coordinator-backend-state.cc:993–1015  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

991}
992
993void Coordinator::BackendState::InstanceStats::ToJson(Value* value, Document* document) {
994 Value instance_id_val(
995 PrintId(exec_params_.instance_id()), document->GetAllocator());
996 value->AddMember("instance_id", instance_id_val, document->GetAllocator());
997
998 // We send 'done' explicitly so we don't have to infer it by comparison with a string
999 // constant in the debug page JS code.
1000 value->AddMember("done", done_, document->GetAllocator());
1001
1002 Value state_val(FragmentInstanceState::ExecStateToString(current_state_),
1003 document->GetAllocator());
1004 value->AddMember("current_state", state_val, document->GetAllocator());
1005
1006 Value fragment_name_val(fragment_->display_name, document->GetAllocator());
1007 value->AddMember("fragment_name", fragment_name_val, document->GetAllocator());
1008
1009 value->AddMember("first_status_update_received", last_report_time_ms_ > 0,
1010 document->GetAllocator());
1011 int64_t elapsed_time_ms =
1012 std::max(static_cast<int64_t>(0), UnixMillis() - last_report_time_ms_);
1013 value->AddMember("time_since_last_heard_from", elapsed_time_ms,
1014 document->GetAllocator());
1015}
1016
1017Coordinator::FragmentStats::FragmentStats(const string& agg_profile_name,
1018 const string& root_profile_name, int num_instances, ObjectPool* obj_pool)

Callers 3

InstanceStatsToJsonMethod · 0.45
BackendsToJsonMethod · 0.45
QueueSizeMethod · 0.45

Calls 10

PrintIdFunction · 0.85
maxFunction · 0.85
UnixMillisFunction · 0.85
NetworkAddressPBToStringFunction · 0.85
MonotonicMillisFunction · 0.85
instance_idMethod · 0.80
GetDetailMethod · 0.80
AddMemberMethod · 0.45
sizeMethod · 0.45
okMethod · 0.45

Tested by 1

QueueSizeMethod · 0.36