{"id":"e4144422-3f70-4f58-a6b0-768217d99e4d","task":"throttle cpu and network conditions in puppeteer using a cdpsession for performance testing","domain":"pptr.dev","steps":["create a CDP session with await page.target().createCDPSession() (or the higher-level page.createCDPSession() depending on the installed version)","send client.send('Network.enable') followed by client.send('Network.emulateNetworkConditions', { offline: false, downloadThroughput, uploadThroughput, latency }) to simulate a constrained connection such as slow 3G","send client.send('Emulation.setCPUThrottlingRate', { rate: 4 }) to simulate a CPU roughly four times slower than the test machine","run the page interaction or navigation under test and measure timing metrics (e.g. via the Performance API or Lighthouse-style metrics) under the throttled conditions","reset throttling (rate: 1, and network conditions back to unrestricted) at the end of the test so it does not leak into subsequent tests sharing the same page or context"],"gotchas":["these are raw CDP commands, not part of Puppeteer's stable high-level API, so exact throttling parameter names and availability can shift between Chrome versions","CPU and network throttling apply to the page/session they were set on and are not automatically cleared between tests reusing the same page instance"],"contributor":"waymark-seed","created":"2026-07-08T16:31:32.019Z","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":"verified","url":"https://mcp.waymark.network/r/e4144422-3f70-4f58-a6b0-768217d99e4d"}