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 globals stats #28822

Merged
merged 2 commits into from
Aug 7, 2024
Merged

Telemetry: Add globals stats #28822

merged 2 commits into from
Aug 7, 2024

Conversation

shilman
Copy link
Member

@shilman shilman commented Aug 6, 2024

Part of #27210

What I did

  • Track usage of the new globals annotation
  • Add test
  • Update telemetry docs

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

Add a globals story, run with STORYBOOK_TELEMETRY_DEBUG=1, and verify that the story is logged in payload.stats.

🦋 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.3 MB 76.3 MB 0 B 0.35 0%
initSize 171 MB 171 MB 45 B -1.16 0%
diffSize 94.5 MB 94.5 MB 45 B -1.16 0%
buildSize 7.42 MB 7.42 MB 0 B -2.37 0%
buildSbAddonsSize 1.61 MB 1.61 MB 0 B -2.25 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.29 MB 2.29 MB 0 B -1.11 0%
buildSbPreviewSize 351 kB 351 kB 0 B 0.58 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.45 MB 4.45 MB 0 B -2.14 0%
buildPreviewSize 2.97 MB 2.97 MB 0 B -2.38 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 12.4s 7.8s -4s -572ms -1 -58%
generateTime 21.8s 22.9s 1s 0.25 4.4%
initTime 18.3s 20s 1.6s -0.66 8.3%
buildTime 12.9s 16.5s 3.5s 2.43 🔺21.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 7.4s 7.8s 491ms -0.5 6.2%
devManagerResponsive 4.8s 5.1s 333ms -0.55 6.4%
devManagerHeaderVisible 888ms 809ms -79ms -0.35 -9.8%
devManagerIndexVisible 924ms 846ms -78ms -0.33 -9.2%
devStoryVisibleUncached 1.1s 1s -113ms -1.22 -10.8%
devStoryVisible 947ms 868ms -79ms -0.34 -9.1%
devAutodocsVisible 742ms 657ms -85ms -0.87 -12.9%
devMDXVisible 761ms 681ms -80ms -0.7 -11.7%
buildManagerHeaderVisible 886ms 669ms -217ms -1.18 -32.4%
buildManagerIndexVisible 920ms 673ms -247ms -1.2 -36.7%
buildStoryVisible 930ms 721ms -209ms -1.15 -29%
buildAutodocsVisible 668ms 642ms -26ms -1.07 -4%
buildMDXVisible 655ms 641ms -14ms -0.6 -2.2%

Greptile Summary

The pull request adds telemetry tracking for the new globals annotation, including updates to tests and documentation.

  • code/core/src/core-server/utils/StoryIndexGenerator.test.ts: Added globals field to stats object in test cases to track globals annotation usage.
  • code/core/src/csf-tools/CsfFile.test.ts: Updated test cases to include checks for globals property in story statistics.
  • code/core/src/csf-tools/CsfFile.ts: Included globals in the list of tracked annotations in the __stats object.
  • code/core/src/types/modules/indexer.ts: Added globals property to IndexInputStats interface for telemetry purposes.
  • docs/configure/telemetry.mdx: Documented new telemetry data collection for globals annotation.

@shilman shilman added maintenance User-facing maintenance tasks telemetry ci:normal labels Aug 6, 2024
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.

LGTM

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

Copy link

nx-cloud bot commented Aug 6, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d391678. 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.

@ndelangen ndelangen merged commit c48fc0f into next Aug 7, 2024
54 of 56 checks passed
@ndelangen ndelangen deleted the shilman/globals-telemetry branch August 7, 2024 09:10
@github-actions github-actions bot mentioned this pull request Aug 7, 2024
29 tasks
@shilman shilman added the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Aug 28, 2024
@JReinhold JReinhold removed the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:normal maintenance User-facing maintenance tasks telemetry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants