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

Function ThreadOverviewUrlCallback

be/src/util/thread.cc:446–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446void ThreadOverviewUrlCallback(bool include_jvm_threads,
447 const Webserver::WebRequest& req, Document* document) {
448 thread_manager->GetThreadOverview(document);
449 if (!include_jvm_threads) return;
450
451 // Add information about the JVM threads
452 TGetJvmThreadsInfoRequest request;
453 request.get_complete_info = false;
454 TGetJvmThreadsInfoResponse response;
455 Status status = JniUtil::GetJvmThreadsInfo(request, &response);
456 if (!status.ok()) {
457 Value error(Substitute("Couldn't retrieve information about JVM threads: $0",
458 status.GetDetail()).c_str(), document->GetAllocator());
459 document->AddMember("error", error, document->GetAllocator());
460 return;
461 }
462 Value jvm_threads_val(kObjectType);
463 jvm_threads_val.AddMember("name", "jvm", document->GetAllocator());
464 jvm_threads_val.AddMember("total", response.total_thread_count,
465 document->GetAllocator());
466 jvm_threads_val.AddMember("daemon", response.daemon_thread_count,
467 document->GetAllocator());
468 document->AddMember("jvm-threads", jvm_threads_val, document->GetAllocator());
469}
470
471void JvmThreadsUrlCallback(const Webserver::WebRequest& req, Document* doc) {
472 DCHECK(doc != NULL);

Callers 1

RegisterUrlCallbacksFunction · 0.85

Calls 5

SubstituteFunction · 0.85
GetThreadOverviewMethod · 0.80
GetDetailMethod · 0.80
okMethod · 0.45
AddMemberMethod · 0.45

Tested by

no test coverage detected