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

feat(frontend): allow to export flamegraph json #616

Merged
merged 1 commit into from
Dec 16, 2021
Merged

Conversation

eh-am
Copy link
Collaborator

@eh-am eh-am commented Dec 16, 2021

Not optimal but it works.
Currently scoped to single flamegraphs (ie. singel view, comparison diff but NOT diff view, since we don't support importing that yet).

Had to store the raw response from /render in the store since that's what adhoc expects. Yadda yadda deltaDiffWrapper is troublesome.

Peek 2021-12-16 11-20

@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2021

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
webapp/public/assets/app.js 317.1 KB (+0.09% 🔺) 6.4 s (+0.09% 🔺) 808 ms (+2.96% 🔺) 7.2 s

@codecov
Copy link

codecov bot commented Dec 16, 2021

Codecov Report

Merging #616 (b8bece3) into main (1533b5c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #616   +/-   ##
=======================================
  Coverage   76.28%   76.28%           
=======================================
  Files          43       43           
  Lines        1454     1454           
  Branches      284      284           
=======================================
  Hits         1109     1109           
  Misses        313      313           
  Partials       32       32           
Impacted Files Coverage Δ
...mponents/FlameGraph/FlameGraphComponent/Header.tsx 88.89% <100.00%> (ø)

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 1533b5c...b8bece3. Read the comment docs.

@pyroscopebot
Copy link
Collaborator

pyroscopebot commented Dec 16, 2021

Parameters

Details
Name Value
BENCH_RUN_FOR 10m
PYROBENCH_RAND_SEED 2306912
PYROBENCH_PROFILE_WIDTH 20
PYROBENCH_PROFILE_DEPTH 20
PYROBENCH_PROFILE_SYMBOL_LENGTH 30
PYROBENCH_APPS 20
PYROBENCH_CLIENTS 20
PYROBENCH_REQUESTS 10000

Result

main pr diff threshold
throughput 146.45 146.56 0.11 (0.08%) 5%
total items processed 122382.00 121919.00 -463.00 (-0.38%) 5%
Details
Name Description Query for main Query for pr
throughput rate(pyroscope_http_request_duration_seconds_count{handler="/ingest", instance="pyroscope:4040"}[5m]) rate(pyroscope_http_request_duration_seconds_count{handler="/ingest", instance="pyroscope_main:4040"}[5m])
total items processed pyroscope_http_request_duration_seconds_count{handler="/ingest", instance="pyroscope:4040"} pyroscope_http_request_duration_seconds_count{handler="/ingest", instance="pyroscope_main:4040"}

Screenshots

Throughput Throughput
Disk Usage Disk Usage
Memory Memory
Upload Errors (Total) Upload Errors (Total)
Successful Uploads (Total) Successful Uploads (Total)
CPU Utilization CPU Utilization

Generated by 🚫 dangerJS against 029487f

@eh-am eh-am force-pushed the feat/export-flamegraph branch from e69b5a4 to b8bece3 Compare December 16, 2021 14:54
exportName: string
) {
const dataStr = `data:text/json;charset=utf-8,${encodeURIComponent(
JSON.stringify(exportObj)
Copy link
Member

Choose a reason for hiding this comment

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

for large files, could we do use something like this? https://github.com/eligrey/FileSaver.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea, I'm going to be bold here and leave as it is until it become a problem though. I believe our flamegraphs are small enough for that to become an issue.

@petethepig
Copy link
Member

Love it! How hard would it be to also add pprof export option? You can use the same render url and set format=pprof to make it work. I guess a slight complication is that you might also have to replace from and until parameters (because default ones are relative to now).

@Rperry2174
Copy link
Contributor

After looking more at this I'm wondering would it be easier to add in the "metadata" that you were mentioning as part of this PR? We could also do separately if that's going to complicate things somewhere else

@eh-am
Copy link
Collaborator Author

eh-am commented Dec 16, 2021

@petethepig @Rperry2174 Let's do pprof in a diff PR, since that requires updates to the metadata.

@eh-am eh-am merged commit 3435a21 into main Dec 16, 2021
@eh-am eh-am deleted the feat/export-flamegraph branch December 16, 2021 19:12
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.

4 participants