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

chore(flamegraph/models): make it mandatory to handle all spyNames #1300

Merged
merged 6 commits into from Jul 25, 2022

Conversation

eh-am
Copy link
Collaborator

@eh-am eh-am commented Jul 22, 2022

BREAKING CHANGE: if a unsupported spyName is received from the server, an error is thrown.

Propagate spyName and narrow its type (now it's a union instead of a simple string).

This forces us to update spyToRegex whenever there's an update to the spyNames list.
For Example, I removed the pyroscope-rs and unknown cases, then lint started barking:

@pyroscope/flamegraph:   78:11  error  Switch is not exhaustive. Cases not matched: "pyroscope-rs" | "unknown"  @typescript-eslint/switch-exhaustiveness-check

Also export spyNames via SpyNameFirstClass and SpyNameOther, in case we want to use that info at runtime. (eg in flamegraph.com)

Copy link
Contributor

@Rperry2174 Rperry2174 left a comment

Choose a reason for hiding this comment

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

Lgtm!

@codecov
Copy link

codecov bot commented Jul 22, 2022

Codecov Report

Merging #1300 (dea6a01) into main (c163b37) will increase coverage by 0.09%.
The diff coverage is 95.24%.

@@            Coverage Diff             @@
##             main    #1300      +/-   ##
==========================================
+ Coverage   68.52%   68.60%   +0.09%     
==========================================
  Files         112      113       +1     
  Lines        3713     3726      +13     
  Branches      842      843       +1     
==========================================
+ Hits         2544     2556      +12     
- Misses       1167     1168       +1     
  Partials        2        2              
Impacted Files Coverage Δ
...aph/src/FlameGraph/FlameGraphComponent/testData.ts 100.00% <ø> (ø)
packages/pyroscope-models/src/index.ts 78.58% <0.00%> (+1.65%) ⬆️
...h/src/FlameGraph/FlameGraphComponent/Flamegraph.ts 90.86% <100.00%> (ø)
...lameGraph/FlameGraphComponent/Flamegraph_render.ts 91.47% <100.00%> (ø)
...egraph/src/FlameGraph/FlameGraphComponent/color.ts 78.27% <100.00%> (-0.86%) ⬇️
...e-flamegraph/src/FlameGraph/FlameGraphRenderer.tsx 48.26% <100.00%> (ø)
packages/pyroscope-models/src/flamebearer.ts 63.34% <100.00%> (ø)
packages/pyroscope-models/src/profile.ts 92.31% <100.00%> (+0.65%) ⬆️
packages/pyroscope-models/src/spyName.ts 100.00% <100.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c163b37...dea6a01. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2022

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
webapp/public/assets/app.js 399.1 KB (+0.03% 🔺) 8 s (+0.03% 🔺) 3.8 s (-0.19% 🔽) 11.8 s
webapp/public/assets/app.css 12.93 KB (0%) 259 ms (0%) 0 ms (+100% 🔺) 259 ms
webapp/public/assets/styles.css 9.8 KB (0%) 197 ms (0%) 0 ms (+100% 🔺) 197 ms
packages/pyroscope-flamegraph/dist/index.js 89.33 KB (+0.11% 🔺) 1.8 s (+0.11% 🔺) 1.5 s (-19.73% 🔽) 3.3 s
packages/pyroscope-flamegraph/dist/index.node.js 80.68 KB (+0.07% 🔺) 1.7 s (+0.07% 🔺) 949 ms (+18.01% 🔺) 2.6 s
packages/pyroscope-flamegraph/dist/index.css 5.84 KB (0%) 117 ms (0%) 0 ms (+100% 🔺) 117 ms

@eh-am eh-am merged commit f7a95a0 into main Jul 25, 2022
@eh-am eh-am deleted the chore/refactor-spyname branch July 25, 2022 13:06
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.

None yet

2 participants