perf(efficiency): 接入真实CPU能量并隔离展示与采样需求

This commit is contained in:
2026-11-04 01:11:24 +08:00
parent a96d188abe
commit 1c26fc18f3
37 changed files with 1249 additions and 179 deletions
+4 -4
View File
@@ -55,14 +55,14 @@ import Foundation
let store = MetricsStore()
store.setPanelVisible(true)
for _ in 0..<40 {
if store.snapshot.processes != nil { break }
if store.processSnapshot != nil { break }
try? await Task.sleep(for: .milliseconds(200))
}
precondition(store.snapshot.processes?.readable ?? 0 > 0)
precondition(store.processSnapshot?.readable ?? 0 > 0)
store.setPanelVisible(false)
precondition(store.snapshot.processes == nil)
precondition(store.processSnapshot == nil)
try? await Task.sleep(for: .milliseconds(2200))
precondition(store.snapshot.processes == nil)
precondition(store.processSnapshot == nil)
store.togglePause()
print("PASS: process CPU boundaries/live baseline, GPU range, VPN total exclusion, bounded interface history, visibility reset")
}