skill-data/core/references/profiling.md
Capture Chrome DevTools performance profiles during browser automation for performance analysis.
Related: commands.md for full command reference, SKILL.md for quick start.
# Start profiling
agent-browser profiler start
# Perform actions
agent-browser navigate https://example.com
agent-browser click "#button"
agent-browser wait 1000
# Stop and save
agent-browser profiler stop ./trace.json
# Start profiling with default categories
agent-browser profiler start
# Start with custom trace categories
agent-browser profiler start --categories "devtools.timeline,v8.execute,blink.user_timing"
# Stop profiling and save to file
agent-browser profiler stop ./trace.json
The --categories flag accepts a comma-separated list of Chrome trace categories. Default categories include:
devtools.timeline -- standard DevTools performance tracesv8.execute -- time spent running JavaScriptblink -- renderer eventsblink.user_timing -- performance.mark() / performance.measure() callslatencyInfo -- input-to-latency trackingrenderer.scheduler -- task scheduling and executiontoplevel -- broad-spectrum basic eventsSeveral disabled-by-default-* categories are also included for detailed timeline, call stack, and V8 CPU profiling data.
agent-browser profiler start
agent-browser navigate https://app.example.com
agent-browser wait --load networkidle
agent-browser profiler stop ./page-load-profile.json
agent-browser navigate https://app.example.com
agent-browser profiler start
agent-browser click "#submit"
agent-browser wait 2000
agent-browser profiler stop ./interaction-profile.json
#!/bin/bash
agent-browser profiler start
agent-browser navigate https://app.example.com
agent-browser wait --load networkidle
agent-browser profiler stop "./profiles/build-${BUILD_ID}.json"
The output is a JSON file in Chrome Trace Event format:
{
"traceEvents": [
{ "cat": "devtools.timeline", "name": "RunTask", "ph": "X", "ts": 12345, "dur": 100, ... },
...
],
"metadata": {
"clock-domain": "LINUX_CLOCK_MONOTONIC"
}
}
The metadata.clock-domain field is set based on the host platform (Linux or macOS). On Windows it is omitted.
Load the output JSON file in any of these tools:
chrome://tracing in any Chromium browser