Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry: Add mount, beforeEach, moduleMock stats #28624

Merged
merged 8 commits into from
Jul 19, 2024

Conversation

shilman
Copy link
Member

@shilman shilman commented Jul 17, 2024

Closes N/A
Telescopes on #28622

What I did

Add stats on CSF feature usage

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Run a sandbox with STORYBOOK_TELEMETRY_DEBUG=1 and observe the payload with the number of mount/beforeEach/moduleMock counts when you use those CSF features.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 76.5 MB 76.5 MB 0 B 1.07 0%
initSize 198 MB 198 MB 1.46 kB 1.78 0%
diffSize 121 MB 121 MB 1.46 kB 1.85 0%
buildSize 7.6 MB 7.6 MB 0 B 1.53 0%
buildSbAddonsSize 1.63 MB 1.63 MB 0 B 1.31 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.3 MB 2.3 MB 0 B 1.53 0%
buildSbPreviewSize 349 kB 349 kB 0 B 1.22 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.47 MB 4.47 MB 0 B 1.53 0%
buildPreviewSize 3.12 MB 3.12 MB 0 B 1.11 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 22.9s 23.5s 574ms 1.41 2.4%
generateTime 20.9s 21.7s 812ms -0.58 3.7%
initTime 21.2s 22.5s 1.3s -0.79 5.8%
buildTime 13.6s 13.1s -499ms -1.5 -3.8%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 9.8s 8s -1s -824ms -0.75 -22.7%
devManagerResponsive 6s 5.3s -713ms -0.88 -13.3%
devManagerHeaderVisible 778ms 939ms 161ms 0.51 17.1%
devManagerIndexVisible 784ms 942ms 158ms 0.37 16.8%
devStoryVisibleUncached 1.4s 1.5s 109ms 1.09 7.1%
devStoryVisible 822ms 1s 183ms 0.57 18.2%
devAutodocsVisible 810ms 745ms -65ms -0.08 -8.7%
devMDXVisible 795ms 785ms -10ms 0.56 -1.3%
buildManagerHeaderVisible 847ms 756ms -91ms -0.41 -12%
buildManagerIndexVisible 852ms 762ms -90ms -0.39 -11.8%
buildStoryVisible 901ms 812ms -89ms -0.39 -11%
buildAutodocsVisible 855ms 706ms -149ms -0.46 -21.1%
buildMDXVisible 687ms 696ms 9ms -0.19 1.3%

@shilman shilman added maintenance User-facing maintenance tasks csf telemetry ci:normal labels Jul 17, 2024
Copy link

nx-cloud bot commented Jul 17, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4bc40ae. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, not sure if we can make the regexp slighly tighter?

code/core/src/csf-tools/CsfFile.ts Outdated Show resolved Hide resolved
code/core/src/csf-tools/CsfFile.test.ts Show resolved Hide resolved
code/core/src/csf-tools/CsfFile.test.ts Show resolved Hide resolved
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jul 19, 2024
Base automatically changed from shilman/csf-feature-telemetry to next July 19, 2024 13:47
@shilman shilman marked this pull request as ready for review July 19, 2024 14:41
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

  • Added telemetry tracking for mount, beforeEach, and moduleMock in /code/core/src/csf-tools/CsfFile.ts
  • Updated tests to cover new telemetry features in /code/core/src/csf-tools/CsfFile.test.ts
  • Enhanced telemetry data capture in /code/core/src/core-server/utils/StoryIndexGenerator.test.ts
  • Modified IndexInputStats interface to include new telemetry properties in /code/core/src/types/modules/indexer.ts

4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@shilman shilman merged commit 42f8d8f into next Jul 19, 2024
52 of 53 checks passed
@shilman shilman deleted the shilman/csf-test-telemetry branch July 19, 2024 15:19
shilman added a commit that referenced this pull request Jul 19, 2024
Telemetry: Add mount, beforeEach, moduleMock stats
(cherry picked from commit 42f8d8f)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:normal csf maintenance User-facing maintenance tasks patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch telemetry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants