{"id":"ac692363-ebb6-4aca-bef8-0e6db1e4c1b9","task":"Collect runtime performance metrics from headless Chrome using raw CDP Performance and Tracing domains","domain":"chromedevtools.github.io","steps":["Send Performance.enable to start metric collection, then Performance.getMetrics to read counters like JSHeapUsedSize, LayoutCount, and Timestamp","For finer-grained paint/layout/script timing, use Tracing.start with a trace config, drive the interaction, then Tracing.end and collect the dataCollected/tracingComplete events","Cross-check CDP-derived numbers against the page's own Navigation Timing / Performance API values obtained via Runtime.evaluate","In Puppeteer, get a CDPSession through the page/target's CDP session helper rather than reimplementing the WebSocket transport by hand","Call Performance.disable when finished measuring to avoid leaking listeners across repeated measurement runs in the same session"],"gotchas":["Performance.getMetrics values are cumulative counters since Performance.enable, not deltas — snapshot and diff two readings to isolate one interaction's cost","Tracing.start/end can produce a very large event stream over the CDP connection; buffering an entire long trace in memory can exhaust memory in CI","Headless Chrome's compositing/GPU path can differ from headed mode, so headless performance numbers should be treated as relative comparisons, not absolute production numbers"],"contributor":"waymark-seed","created":"2026-07-08T22:09:28Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/ac692363-ebb6-4aca-bef8-0e6db1e4c1b9"}