改结构
This commit is contained in:
@@ -458,6 +458,12 @@ nlohmann::json taskflow_trace_json(
|
||||
nlohmann::json executions = nlohmann::json::array();
|
||||
for (const auto& task : trace.tasks) {
|
||||
const auto found = node_ids.find(task.native_id);
|
||||
nlohmann::json cooperative_waits = nlohmann::json::array();
|
||||
for (const auto& wait : task.cooperative_waits) {
|
||||
cooperative_waits.push_back({
|
||||
{"started_ms", wait.started_ms},
|
||||
{"finished_ms", wait.finished_ms}});
|
||||
}
|
||||
executions.push_back({
|
||||
{"native_id", std::to_string(task.native_id)},
|
||||
{"node_id", found == node_ids.end() ? std::string{} : found->second},
|
||||
@@ -469,6 +475,7 @@ nlohmann::json taskflow_trace_json(
|
||||
{"completed_ms", task.completed_ms},
|
||||
{"duration_ms", task.duration_ms},
|
||||
{"cooperative_wait_ms", task.cooperative_wait_ms},
|
||||
{"cooperative_waits", std::move(cooperative_waits)},
|
||||
{"observer_entry_ms", task.observer_entry_ms},
|
||||
{"observer_exit_ms", task.observer_exit_ms},
|
||||
{"queue_wait_ms", task.queue_wait_ms}
|
||||
|
||||
Reference in New Issue
Block a user