This commit is contained in:
2026-08-15 21:48:23 +08:00
parent 26bbc29a16
commit 023250c0fc
45 changed files with 457 additions and 415 deletions
+29 -9
View File
@@ -219,7 +219,7 @@ using gallery_detail::Json;
Json protocol_base() {
return {{"category", "gallery"},
{"protocol", "renderive.control-gallery"},
{"protocol_version", 4}};
{"protocol_version", 5}};
}
Json case_contract(std::string_view case_id) {
@@ -234,6 +234,20 @@ Json dashboard_field(std::string_view label, std::string_view source,
result["digits"] = digits;
return result;
}
Json dashboard_trend_field(std::string_view label, std::string_view source,
std::string_view trend_group,
std::string_view format = "integer", int digits = -1) {
Json result = dashboard_field(label, source, format, digits);
result["trend_group"] = trend_group;
return result;
}
Json dashboard_summary_field(std::string_view label, std::string_view source,
std::string_view trend_group,
std::string_view format = "integer", int digits = -1) {
Json result = dashboard_trend_field(label, source, trend_group, format, digits);
result["summary"] = true;
return result;
}
template <class Object>
const Json& described_field(std::string_view name) {
@@ -374,16 +388,16 @@ Json dashboard_contract() {
}},
{"performance", {
{"fields", Json::array({
dashboard_field("后端渲染 FPS", "performance.measured_fps", "fixed", 1),
dashboard_field("像素响应 FPS", "performance.pixel_response_fps", "fixed", 1),
dashboard_field("浏览器呈现 FPS", "client_performance.presentation_fps", "fixed", 1),
dashboard_field("WS 往返 ms", "client_performance.frame_round_trip_ms", "fixed", 2),
dashboard_summary_field("后端渲染 FPS", "performance.measured_fps", "FPS", "fixed", 1),
dashboard_summary_field("像素响应 FPS", "performance.pixel_response_fps", "FPS", "fixed", 1),
dashboard_trend_field("浏览器呈现 FPS", "client_performance.presentation_fps", "FPS", "fixed", 1),
dashboard_trend_field("WS 往返 ms", "client_performance.frame_round_trip_ms", "帧延迟", "fixed", 2),
dashboard_field("未呈现覆盖", "client_performance.overwritten_pixel_frames"),
dashboard_field("Core 渲染 ms", "performance.last_render_ms", "fixed", 2),
dashboard_summary_field("帧完成延迟 ms", "performance.last_render_ms", "帧延迟", "fixed", 2),
dashboard_field("Core 滑动平均 ms", "performance.average_render_ms", "fixed", 2),
dashboard_field("Core P95 ms", "performance.render_p95_ms", "fixed", 2),
dashboard_field("Core P99 ms", "performance.render_p99_ms", "fixed", 2),
dashboard_field("像素编码 ms", "performance.last_pixel_encode_ms", "fixed", 2),
dashboard_summary_field("像素编码 ms", "performance.last_pixel_encode_ms", "帧延迟", "fixed", 2),
dashboard_field("编码 P95 ms", "performance.pixel_encode_p95_ms", "fixed", 2),
dashboard_field("编码 P99 ms", "performance.pixel_encode_p99_ms", "fixed", 2),
dashboard_field("WS 平均 ms", "client_performance.frame_round_trip_average_ms", "fixed", 2),
@@ -394,9 +408,15 @@ Json dashboard_contract() {
dashboard_field("呈现 P99 ms", "client_performance.display_interval_p99_ms", "fixed", 2),
dashboard_field("响应负载 MB/s", "performance.pixel_payload_megabytes_per_second", "fixed", 1),
dashboard_field("TBB 并发度", "scheduler.concurrency"),
dashboard_field("活动 Worker", "scheduler.active_workers"),
dashboard_trend_field("活动 Worker", "scheduler.active_workers", "调度与队列"),
dashboard_field("峰值 Worker", "scheduler.peak_workers"),
dashboard_field("活动外部线程", "scheduler.active_external_threads"),
dashboard_trend_field("Scene 排队", "queue_pressure.scene_execution.queued", "调度与队列"),
dashboard_trend_field("Render Domain 排队", "queue_pressure.render_domain.queued", "调度与队列"),
dashboard_trend_field("GPU Completion 活动", "queue_pressure.gpu_completion.active", "调度与队列"),
dashboard_field("Scene Backpressure", "queue_pressure.scene_execution.backpressure_count"),
dashboard_field("Render Backpressure", "queue_pressure.render_domain.backpressure_count"),
dashboard_field("GPU Backpressure", "queue_pressure.gpu_completion.backpressure_count"),
described_dashboard_field<renderive::Plot_Frame_Status>(
"kernel_observer", "pending_frame_count"),
described_dashboard_field<renderive::Plot_Frame_Status>(
@@ -556,7 +576,7 @@ Json frame_mode_contract(Gallery_Frame_Mode mode) {
std::string Gallery_Protocol::catalog_json() {
Json result = protocol_base();
result["type"] = "catalog";
result["transport"] = {{"events", "websocket-text"}, {"pixels", "websocket-binary-rvp1"},
result["transport"] = {{"events", "websocket-text"}, {"pixels", "websocket-binary-rvp2"},
{"http_api", false}, {"socket_per_canvas", true}};
result["navigation"] = {
{"default_mode", gallery_enum_id(Gallery_Frame_Mode::Low_Latency)},