Skip to main content

euv_core/render/telemetry/
struct.rs

1use super::*;
2
3/// Truthful per-frame adaptive rendering and presentation observability metrics snapshot.
4#[derive(Clone, Copy, Data, Debug, PartialEq, Serialize)]
5pub struct AdaptiveFrameMetrics {
6    /// Active display mode refresh rate in Hertz (`Unobservable` when host does not expose display mode).
7    #[get(type(copy))]
8    pub(crate) display_mode_hz: ObservableMetric<f64>,
9    /// Cumulative frame callbacks received during the active window.
10    #[get(type(copy))]
11    pub(crate) frame_callback_count: u64,
12    /// Observed frame-callback interval in milliseconds (distinct from compositor presentation).
13    #[get(type(copy))]
14    pub(crate) frame_callback_interval_ms: ObservableMetric<f64>,
15    /// Number of newly presented frames confirmed by compositor or proxy (`Unobservable` when unverified).
16    #[get(type(copy))]
17    pub(crate) actual_presented_new_frames: ObservableMetric<u64>,
18    /// 50th percentile actual present interval in milliseconds.
19    #[get(type(copy))]
20    pub(crate) actual_present_interval_p50_ms: ObservableMetric<f64>,
21    /// 95th percentile actual present interval in milliseconds.
22    #[get(type(copy))]
23    pub(crate) actual_present_interval_p95_ms: ObservableMetric<f64>,
24    /// 99th percentile actual present interval in milliseconds.
25    #[get(type(copy))]
26    pub(crate) actual_present_interval_p99_ms: ObservableMetric<f64>,
27    /// Source provenance of the present interval metrics (`CompositorMeasured`, `SubmissionProxy`, `Unobservable`).
28    #[get(type(copy))]
29    pub(crate) present_timing_source: PresentTimingSource,
30    /// Explicit outcome of the most recent presentation attempt (`Submitted`, `SkippedUnchanged`, `Failed`).
31    #[get(type(copy))]
32    pub(crate) present_outcome: SurfacePresentOutcome,
33    /// Cumulative presentation submission failures encountered.
34    #[get(type(copy))]
35    pub(crate) present_submit_failures: u64,
36    /// Cumulative post-submission presentation failures encountered.
37    #[get(type(copy))]
38    pub(crate) present_failures: u64,
39    /// Measured CPU rasterization duration in milliseconds (`Unobservable` when uninstrumented or inactive).
40    #[get(type(copy))]
41    pub(crate) cpu_raster_ms: ObservableMetric<f64>,
42    /// True whenever a CPU RGBA software mirror or software framebuffer path was active on this frame.
43    #[get(type(copy))]
44    pub(crate) cpu_mirror_active: bool,
45    /// Exact texture/framebuffer bytes uploaded on this frame (`0` on steady-state direct GPU draw).
46    #[get(type(copy))]
47    pub(crate) texture_upload_bytes: u64,
48    /// Active pixel/command upload strategy used for this frame.
49    #[get(type(copy))]
50    pub(crate) upload_strategy: UploadStrategy,
51    /// Measured GPU execution duration in milliseconds (`Unobservable` without GPU timestamp queries).
52    #[get(type(copy))]
53    pub(crate) gpu_exec_ms: ObservableMetric<f64>,
54    /// Measured GPU wait/stall duration in milliseconds (`Unobservable` without fence/queue timing).
55    #[get(type(copy))]
56    pub(crate) gpu_wait_ms: ObservableMetric<f64>,
57    /// End-to-end input event to verified presentation latency in milliseconds.
58    #[get(type(copy))]
59    pub(crate) input_to_present_latency_ms: ObservableMetric<f64>,
60    /// Target frame interval in milliseconds derived from display mode (e.g., `6.94 ms` for 144 Hz).
61    #[get(type(copy))]
62    pub(crate) target_frame_interval_ms: f64,
63    /// Whether the OS is actively throttling display refresh rate below the nominal mode.
64    #[get(type(copy))]
65    pub(crate) os_refresh_throttled: ObservableMetric<bool>,
66    /// Snapshot of the unified 5-stage adaptive render router and handoff coordinator state.
67    #[get(type(copy))]
68    pub(crate) adaptive_router: AdaptiveRouterSnapshot,
69}