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

Method GetThreadOverview

be/src/util/thread.cc:228–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228void ThreadMgr::GetThreadOverview(Document* document) {
229 lock_guard<mutex> l(lock_);
230 if (metrics_enabled_) {
231 document->AddMember("total_threads", current_num_threads_metric_->GetValue(),
232 document->GetAllocator());
233 }
234 Value lst(kArrayType);
235 for (const ThreadCategoryMap::value_type& category: thread_categories_) {
236 Value val(kObjectType);
237 Value name(category.first.c_str(), document->GetAllocator());
238 val.AddMember("name", name, document->GetAllocator());
239 val.AddMember("size", static_cast<uint64_t>(category.second.threads_by_id.size()),
240 document->GetAllocator());
241 val.AddMember("num_created",
242 static_cast<uint64_t>(category.second.num_threads_created),
243 document->GetAllocator());
244 // TODO: URLEncode() name?
245 lst.PushBack(val, document->GetAllocator());
246 }
247 document->AddMember("thread-groups", lst, document->GetAllocator());
248}
249
250void ThreadMgr::ThreadGroupUrlCallback(const Webserver::WebRequest& req,
251 Document* document) {

Callers 1

Calls 4

PushBackMethod · 0.80
AddMemberMethod · 0.45
GetValueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected