feat(monitors): 接入统一面板数据与按需进程采样

This commit is contained in:
2026-11-02 22:58:33 +08:00
parent 7df2bbc7c1
commit 604086bbbb
14 changed files with 391 additions and 32 deletions
+25
View File
@@ -0,0 +1,25 @@
import Foundation
nonisolated struct ProcessIdentity: Hashable, Sendable {
let pid: Int32
let seconds: UInt64
let microseconds: UInt64
}
nonisolated struct ProcessMetrics: Identifiable, Sendable {
let id: ProcessIdentity
let name: String
let path: String?
let cpu: Double? // One logical CPU = 100%; may exceed 1.
let residentBytes: UInt64?
let threads: Int?
let restricted: Bool
}
nonisolated struct ProcessSnapshot: Sendable {
let date: Date
let enumerated: Int
let readable: Int
let rows: [ProcessMetrics]
let failed: Bool
}