refactor(project): 清理闲置展示链路与重复采样状态
This commit is contained in:
@@ -23,19 +23,17 @@ nonisolated struct ProcessEnergyReply: Codable, Sendable {
|
||||
let readings: [ProcessEnergyReading]
|
||||
}
|
||||
nonisolated struct ProcessEnergyUsage: Identifiable, Sendable {
|
||||
let process: ProcessMetrics
|
||||
let id: ProcessIdentity
|
||||
let watts: Double
|
||||
let seconds: TimeInterval
|
||||
var id: ProcessIdentity { process.id }
|
||||
var formattedPower: String { watts >= 1 ? String(format: "%.2f W", watts) : String(format: "%.1f mW", watts * 1000) }
|
||||
}
|
||||
nonisolated struct ProcessEnergySnapshot: Sendable {
|
||||
enum State: Sendable { case waiting, available, partial, unavailable, unsupported }
|
||||
let date: Date
|
||||
let candidates: Int
|
||||
let readable: Int
|
||||
let measured: Int
|
||||
let rows: [ProcessEnergyUsage] // All valid measurements; no CPU prefilter.
|
||||
var measured: Int { rows.count }
|
||||
let state: State
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user