Skip to content

feat: add perf metrics and frames commands#703

Open
thymikee wants to merge 3 commits into
mainfrom
codex/perf-metrics-frames
Open

feat: add perf metrics and frames commands#703
thymikee wants to merge 3 commits into
mainfrom
codex/perf-metrics-frames

Conversation

@thymikee
Copy link
Copy Markdown
Member

@thymikee thymikee commented Jun 7, 2026

Summary

Adds an explicit perf subcommand API for session performance evidence:

  • agent-device perf metrics --json returns the broad session metrics payload: startup, CPU, memory, and frame health where supported.
  • agent-device perf frames --json returns a focused frame/jank-health payload with only metrics.fps and sampling.fps.
  • Bare agent-device perf --json and agent-device metrics --json remain compatibility aliases for perf metrics --json.

Structured clients now project the same API through client.observability.perf({ area: 'metrics' }) and client.observability.perf({ area: 'frames' }); { action: 'sample' } is accepted for the current sampling action. Invalid areas/actions are rejected in both CLI parsing and daemon handling.

perf frames uses a frame-only sampling path, so it avoids CPU/memory collection when agents are repeatedly checking focused jank windows. CLI help, website docs, and SkillGym guidance now route native slowness to perf metrics / perf frames and keep React render profiling under react-devtools.

Closes #695

Validation

Local validation passed:

  • pnpm check:fallow --base origin/main
  • pnpm exec vitest run src/utils/__tests__/perf-args.test.ts src/__tests__/cli-perf.test.ts src/__tests__/client.test.ts src/daemon/handlers/__tests__/session-perf-area.test.ts
  • pnpm check:quick
  • git diff --check origin/main...HEAD

CI reran on 81c7ab4be; the previously failing Fallow Code Quality check is fixed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-703/

Built to branch gh-pages at 2026-06-07 10:24 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

Size Report

Metric Base Current Diff
JS raw 1.1 MB 1.1 MB +3.1 kB
JS gzip 371.4 kB 372.4 kB +939 B
npm tarball 482.0 kB 483.0 kB +1.1 kB
npm unpacked 1.6 MB 1.6 MB +3.4 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 29.6 ms 29.3 ms -0.3 ms
CLI --help 44.7 ms 44.7 ms +0.0 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/session.js +1.6 kB +355 B
dist/src/8699.js +591 B +185 B
dist/src/1352.js +316 B +90 B
dist/src/command-metadata.js +95 B +51 B
dist/src/args.js +129 B +39 B

@thymikee thymikee force-pushed the codex/perf-metrics-frames branch 3 times, most recently from 1f9dd90 to 81c7ab4 Compare June 7, 2026 08:24
@thymikee thymikee force-pushed the codex/perf-metrics-frames branch from 81c7ab4 to 535ec37 Compare June 7, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add perf metrics and frames subcommands as native diagnostics foundation

1 participant