[Dashboard] Logical view backend for dashboard (#6590)

This commit is contained in:
Yunzhi Zhang
2019-12-30 13:08:08 -08:00
committed by Philipp Moritz
parent 8b16847c02
commit 65acb54553
9 changed files with 162 additions and 15 deletions
+15 -1
View File
@@ -1118,13 +1118,27 @@ void CoreWorker::HandleGetCoreWorkerStats(const rpc::GetCoreWorkerStatsRequest &
rpc::GetCoreWorkerStatsReply *reply,
rpc::SendReplyCallback send_reply_callback) {
absl::MutexLock lock(&mutex_);
reply->set_webui_display(webui_display_);
auto stats = reply->mutable_core_worker_stats();
stats->set_num_pending_tasks(task_manager_->NumPendingTasks());
stats->set_num_object_ids_in_scope(reference_counter_->NumObjectIDsInScope());
if (!current_task_.TaskId().IsNil()) {
stats->set_current_task_desc(current_task_.DebugString());
for (auto const it : current_task_.FunctionDescriptor()) {
stats->add_current_task_func_desc(it);
}
}
stats->set_ip_address(rpc_address_.ip_address());
stats->set_port(rpc_address_.port());
stats->set_actor_id(actor_id_.Binary());
auto used_resources_map = stats->mutable_used_resources();
for (auto const &it : *resource_ids_) {
double quantity = 0;
for (auto const &pair : it.second) {
quantity += pair.second;
}
(*used_resources_map)[it.first] = quantity;
}
stats->set_webui_display(webui_display_);
send_reply_callback(Status::OK(), nullptr, nullptr);
}
+12
View File
@@ -170,4 +170,16 @@ message CoreWorkerStats {
int32 num_pending_tasks = 2;
// Number of object ids in local scope.
int32 num_object_ids_in_scope = 3;
// Function descriptor of the currently executing task.
repeated string current_task_func_desc = 4;
// IP address of the core worker.
string ip_address = 6;
// Port of the core worker.
int64 port = 7;
// Actor ID.
bytes actor_id = 8;
// A map from the resource name (e.g. "CPU") to the amount of resource used.
map<string, double> used_resources = 9;
// A string displayed on Dashboard.
string webui_display = 10;
}
+1 -3
View File
@@ -131,10 +131,8 @@ message GetCoreWorkerStatsRequest {
}
message GetCoreWorkerStatsReply {
// String displayed on Web UI.
string webui_display = 1;
// Debug information returned from the core worker.
CoreWorkerStats core_worker_stats = 2;
CoreWorkerStats core_worker_stats = 1;
}
service CoreWorkerService {
+1 -3
View File
@@ -53,10 +53,8 @@ message WorkerStats {
uint32 pid = 1;
// Whether this is a driver.
bool is_driver = 2;
// String displayed on Web UI.
string webui_display = 3;
// Debug information returned from the core worker.
CoreWorkerStats core_worker_stats = 4;
CoreWorkerStats core_worker_stats = 3;
}
message ViewData {
-1
View File
@@ -3012,7 +3012,6 @@ void NodeManager::HandleNodeStatsRequest(const rpc::NodeStatsRequest &request,
worker_stats->set_pid(worker->Pid());
worker_stats->set_is_driver(false);
reply->set_num_workers(reply->num_workers() + 1);
worker_stats->set_webui_display(r.webui_display());
worker_stats->mutable_core_worker_stats()->MergeFrom(r.core_worker_stats());
if (reply->num_workers() == all_workers.size()) {
send_reply_callback(Status::OK(), nullptr, nullptr);