refactor(project): 清理闲置展示链路与重复采样状态

This commit is contained in:
2026-11-09 00:41:09 +08:00
parent 7b3abe37c5
commit b73d51c953
57 changed files with 210 additions and 2822 deletions
+2 -4
View File
@@ -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
}