perf(menubar): 降低绘制驻留并复用原生进程表与缩略图
This commit is contained in:
@@ -21,7 +21,7 @@ nonisolated enum SamplingDiagnostics {
|
||||
try? FileHandle.standardOutput.write(contentsOf: data + Data([10]))
|
||||
}
|
||||
|
||||
static func record(_ snapshot: MetricsSnapshot, event: String = "sample", hiddenHostAlive: Bool? = nil) {
|
||||
static func record(_ snapshot: MetricsSnapshot, event: String = "sample", hiddenHostAlive: Bool? = nil, windowNumber: Int? = nil, hoveredPlots: Int? = nil, nativePlots: Int? = nil, pointerInsidePanel: Bool? = nil, plotBounds: [[Double]]? = nil) {
|
||||
guard enabled else { return }
|
||||
var payload: [String: Any] = [
|
||||
"event": event, "timestamp": snapshot.date.timeIntervalSince1970,
|
||||
@@ -31,6 +31,11 @@ nonisolated enum SamplingDiagnostics {
|
||||
"load": snapshot.load
|
||||
]
|
||||
payload["hiddenHostAlive"] = hiddenHostAlive
|
||||
payload["windowNumber"] = windowNumber
|
||||
payload["hoveredPlots"] = hoveredPlots
|
||||
payload["nativePlots"] = nativePlots
|
||||
payload["pointerInsidePanel"] = pointerInsidePanel
|
||||
payload["plotBounds"] = plotBounds
|
||||
payload["cpu"] = snapshot.cpu?.usage
|
||||
payload["cores"] = snapshot.cpu?.cores.count
|
||||
payload["cpuTemperature"] = snapshot.cpuTemperature
|
||||
|
||||
Reference in New Issue
Block a user