1 // Copyright 2024 The ChromiumOS Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 use metrics_events_product::MetricEventType as VendorMetricEventType; 6 use serde::Deserialize; 7 use serde::Serialize; 8 9 #[cfg(windows)] 10 use crate::sys::windows::WaveFormatDetails; 11 12 #[derive(Clone, Debug, Serialize, Deserialize)] 13 pub enum MetricEventType { 14 CpuUsage, 15 MemoryUsage, 16 Fps, 17 JankyFps, 18 NetworkTxRate, 19 NetworkRxRate, 20 Interrupts, 21 FrameTime, 22 EmulatorGraphicsFreeze, 23 EmulatorGraphicsUnfreeze, 24 EmulatorGfxstreamVkAbortReason, 25 ChildProcessExit { 26 exit_code: u32, 27 #[cfg(windows)] 28 process_type: win_util::ProcessType, 29 }, 30 ReadIo, 31 WriteIo, 32 #[cfg(windows)] 33 AudioFormatRequestOk(WaveFormatDetails), 34 #[cfg(windows)] 35 AudioFormatModifiedOk(WaveFormatDetails), 36 #[cfg(windows)] 37 AudioFormatFailed(WaveFormatDetails), 38 TscCoresOutOfSync, 39 NetworkTxRateSummarized, 40 NetworkRxRateSummarized, 41 DllLoaded(String), 42 GraphicsHangRenderThread, 43 GraphicsHangSyncThread, 44 AudioNoopStreamForced, 45 AudioPlaybackError, 46 RtcWakeup, 47 VirtioWakeup { 48 virtio_id: u32, 49 }, 50 VcpuShutdownError, 51 SnapshotSaveMemoryLatency, 52 SnapshotSaveOverallLatency, 53 SnapshotRestoreMemoryLatency, 54 SnapshotRestoreOverallLatency, 55 Other(i64), 56 Vendor(VendorMetricEventType), 57 } 58