Skip to content

feat: CLI will ask to send in performance profile if emitted by app#1478

Open
rix0rrr wants to merge 4 commits into
mainfrom
huijbers/perf-counters
Open

feat: CLI will ask to send in performance profile if emitted by app#1478
rix0rrr wants to merge 4 commits into
mainfrom
huijbers/perf-counters

Conversation

@rix0rrr
Copy link
Copy Markdown
Contributor

@rix0rrr rix0rrr commented May 6, 2026

This adds a new feature where the CDK app can emit a performance profile to a well-known file, and the CLI will ask the user whether to send it in as part of telemetry or not.

The question will be posed as:

🔍 Your CDK app produced a performance profile to help AWS diagnose slow synthesis. Send in for analysis? (Y)es (N)o (A)lways Neve(R) (V)iew

And the user can answer "Never" to permanently record that they never want to do this. Their preference will be stored in a config file in the home directory.

If the user interface is not connected to a TTY or telemetry has been disabled altogether, the question will not be asked and an automatic "no" is assumed.

The data itself depends on what the CDK app is going to emit (not fully written yet), but is going to look something like this:

{
  "Construction-count": 1,
  "Construction-total": 26352,
  "fn:child_process.spawnSync-count": 79,
  "fn:child_process.spawnSync-total": 4884,
  "Synth-count": 1,
  "Synth-total": 4657,
  "Load Time-count": 1,
  "Load Time-total": 4113,
  "fn:resolve-count": 98859,
  "fn:resolve-total": 2832,
  "fn:child_process.execFileSync-count": 3,
  "fn:child_process.execFileSync-total": 935,
  /* ... */
}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

This adds a new feature where the CDK app can emit a performance profile
to a well-known file, and the CLI will ask the user whether to send it
in as part of telemetry or not.

The question will be posed as:

```
App synthesis produced a performance profile. Send in for analysis? (Y)es (N)o (A)lways N(E)ver
```

And the user can answer "Never" to permanently record that they never
want to do this.
@rix0rrr rix0rrr requested a review from a team May 6, 2026 09:11
@aws-cdk-automation aws-cdk-automation requested a review from a team May 6, 2026 09:12
@github-actions github-actions Bot added the p2 label May 6, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2026

Codecov Report

❌ Patch coverage is 58.68545% with 88 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.54%. Comparing base (60cdf66) to head (87c07d8).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
packages/aws-cdk/lib/cli/cli.ts 16.48% 76 Missing ⚠️
...kages/aws-cdk/lib/cli/telemetry/telemetry-prefs.ts 78.78% 7 Missing ⚠️
packages/aws-cdk/lib/cli/telemetry/session.ts 94.82% 3 Missing ⚠️
packages/aws-cdk/lib/cli/util/fs-util.ts 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1478      +/-   ##
==========================================
- Coverage   88.10%   87.54%   -0.57%     
==========================================
  Files          74       76       +2     
  Lines       10669    10878     +209     
  Branches     1457     1473      +16     
==========================================
+ Hits         9400     9523     +123     
- Misses       1241     1327      +86     
  Partials       28       28              
Flag Coverage Δ
suite.unit 87.54% <58.68%> (-0.57%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants