所有权指针明确

This commit is contained in:
2026-08-28 14:10:36 +08:00
parent e07d16ea74
commit 93d3f93774
38 changed files with 407 additions and 380 deletions
+27
View File
@@ -83,6 +83,33 @@ BENCHMARK_DEFINE_F(Control_Path, Timestamped_Drag_Admission)(
benchmark::DoNotOptimize(result.result);
}
state.SetItemsProcessed(state.iterations());
const auto runtime = service->call_tool(
"aethera_task_runtime", nlohmann::json::object());
if (runtime.result != Tool_Call_Result::ok) {
state.SkipWithError("Taskflow runtime diagnostics were rejected");
return;
}
const auto milliseconds = [](const nlohmann::json& value,
std::string_view key) {
return static_cast<double>(value.at(key).get<std::uint64_t>()) /
1'000'000.0;
};
state.counters["taskflow_wall_ms"] =
milliseconds(runtime.content, "observed_wall_time_ns");
state.counters["worker_busy_ms"] =
milliseconds(runtime.content, "worker_busy_time_ns");
state.counters["worker_cpu_ms"] =
milliseconds(runtime.content, "worker_cpu_time_ns");
state.counters["worker_utilization_pct"] =
runtime.content.at("worker_utilization").get<double>();
state.counters["worker_cpu_utilization_pct"] =
runtime.content.at("worker_cpu_utilization").get<double>();
state.counters["active_taskflows"] =
static_cast<double>(runtime.content.at("active_taskflows").get<std::size_t>());
state.counters["completed_taskflows"] =
static_cast<double>(runtime.content.at("completed_taskflows").get<std::size_t>());
state.SetLabel(runtime.content.at("longest_task").at("name").get<std::string>());
}
BENCHMARK(decode_timestamped_drag);