docs/src/app/profiler/page.mdx
Capture Chrome DevTools performance profiles during browser automation. Use profiles to diagnose slow page loads, expensive JavaScript, layout thrashing, and other performance bottlenecks in agentic workflows.
# Start profiling
agent-browser profiler start
# Perform actions
agent-browser navigate https://example.com
agent-browser click "#button"
# Stop and save profile
agent-browser profiler stop ./trace.json
The output JSON file can be loaded into Chrome DevTools, Perfetto UI, or any tool that accepts Chrome Trace Event format.
The --categories flag accepts a comma-separated list of Chrome trace categories.
agent-browser profiler start --categories "devtools.timeline,v8.execute,blink.user_timing"
Default categories include devtools.timeline, v8.execute, blink,
blink.user_timing, latencyInfo, renderer.scheduler, toplevel, and
several disabled-by-default-* categories for detailed CPU profiling and
call stack analysis.
The output is a JSON file in Chrome Trace Event format:
{
"traceEvents": [
{
"cat": "devtools.timeline",
"name": "RunTask",
"ph": "X",
"ts": 12345,
"dur": 100,
"pid": 1,
"tid": 1
}
],
"metadata": {
"clock-domain": "LINUX_CLOCK_MONOTONIC"
}
}
The metadata.clock-domain field reflects the host platform (Linux or macOS).
On Windows it is omitted.
chrome://tracing in any Chromium browser