react-profiler-stop
Stops CPU profiling and captures the React commit tree, storing results for later analysis and queries. Use it after starting a session and exercising the app to collect performance data.
Instructions
Stop CPU profiling and collect the cpuProfile + React commit tree. Stores the results for react-profiler-analyze, profiler-commit-query and profiler-cpu-query. Call react-profiler-start first, then exercise the app, then call this. Returns { duration_ms, sample_count, fiber_renders_captured, total_react_commits, hot_commit_indices, react_render_ms, react_render_share_pct, react_render_peak_1s_pct }. If some fibers' display names could not be resolved (typically modals, tooltips or animations that unmounted before stop), it also returns { unattributed_ms, unattributed_fiber_count, unattributed_commit_count }: the work missing from the per-component breakdown. Per-commit durations stay correct. Fails if no active profiling session exists, another stop is running, the CDP connection was lost during recording, or another session took the run over.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device_id": "<device_id>"
},
"name": "react-profiler-stop"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. Range: 1 to 65535. | |
| device_id | Yes | Device ID passed to react-profiler-start. |