test(perf): add macOS Tauri WebView performance harness

Drive the production home traffic graph through embedded WebDriver in an
isolated optimized measurement build. Record attributed WebContent and main
process CPU/RSS distributions across foreground, hidden and restored phases.

Keep replay, raw reports, independent-run comparison, cleanup checks and
focused validation available through project commands. Normal release builds
exclude the automation service and measurement entry points.
This commit is contained in:
Tunglies
2026-09-07 07:13:24 +08:00
parent dd7b032cb1
commit b39c5f9b6d
25 changed files with 5350 additions and 656 deletions
+15
View File
@@ -202,6 +202,21 @@ class TrafficWorkerClient {
) => {
const message = event.data
if (message.type === 'snapshot') {
if (import.meta.env.MODE === 'perf') {
document.documentElement.dataset.perfWorker = String(
message.lastTimestamp ?? 0,
)
document.documentElement.dataset.perfPoints = String(
message.availableDataPoints.length,
)
const last = message.availableDataPoints.at(-1)
document.documentElement.dataset.perfLastUp = String(
last?.up ?? 0,
)
document.documentElement.dataset.perfLastDown = String(
last?.down ?? 0,
)
}
this.listeners.forEach((listener) => {
listener(message)
})