What problem does it solve? Measuring request-path CPU, memory, and latency of the cfw-api Cloudflare Worker under real load is error-prone: client-side timing conflates network and cold starts, local CPU profiles inflate wall time, and single-hostname baselines are unusable. This runbook provides a rigorous differential measurement methodology using disposable api-perf Worker Previews. ## Core Features & Use Cases - Preview Deployment & Load Generation: Deploy branch-scoped api-perf Previews via repository_dispatch, authenticate through Cloudflare Access service tokens plus OpenRouter API keys, and generate load with FakeProvider endpoints at no cost. - Differential CPU Measurement: Compare a branch Preview against a main Preview using worker-reported cpuTime from Datadog log events, grouped per request with statistically sound percentile sampling. - Memory & Leak Analysis: Track per-version memoryUsageBytes quantiles to distinguish footprint changes from leaks, and capture pre-traffic heap snapshots via workerd serve for retainer attribution. - Use Case: Before merging a streaming-pipeline change, deploy Previews from main and your branch, run matched load at production-like chunk pacing, and compare p50/p90/p99 cpuTime per request to prove the optimization is real. ## Quick Start Deploy an api-perf Preview from my branch and measure its per-request CPU against a main-branch baseline using the perf preview query script and Datadog worker events.