feat(monitors): 接入统一面板数据与按需进程采样
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user