jonhoo / inferno

A Rust port of FlameGraph
Other
1.65k stars 118 forks source link

Add colour palette for python traces #240

Closed mrob95 closed 1 year ago

mrob95 commented 2 years ago

Adds a new colour palette for python. Aiming to distinguish four cases:

I've tested it out in a few scenarios and it definitely makes the output more understandable at a glance: image image

mrob95 commented 2 years ago

I have mainly been testing this with the austin profiler.

@benfred Do you think this could be adapted to work with py-spy as well? It looks to me like py-spy removes a lot of the info which would allow us to tell the difference between user code and library code, but it would be great if we could make it work.

codecov[bot] commented 2 years ago

Codecov Report

Base: 90.21% // Head: 90.33% // Increases project coverage by +0.11% :tada:

Coverage data is based on head (08a4194) compared to base (8c0a28c). Patch coverage: 98.41% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #240 +/- ## ========================================== + Coverage 90.21% 90.33% +0.11% ========================================== Files 19 19 Lines 4179 4241 +62 ========================================== + Hits 3770 3831 +61 - Misses 409 410 +1 ``` | [Impacted Files](https://codecov.io/gh/jonhoo/inferno/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jon+Gjengset) | Coverage Δ | | |---|---|---| | [src/flamegraph/color/mod.rs](https://codecov.io/gh/jonhoo/inferno/pull/240/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jon+Gjengset#diff-c3JjL2ZsYW1lZ3JhcGgvY29sb3IvbW9kLnJz) | `86.56% <50.00%> (-0.30%)` | :arrow_down: | | [src/flamegraph/color/palettes.rs](https://codecov.io/gh/jonhoo/inferno/pull/240/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jon+Gjengset#diff-c3JjL2ZsYW1lZ3JhcGgvY29sb3IvcGFsZXR0ZXMucnM=) | `99.04% <100.00%> (+0.12%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jon+Gjengset). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jon+Gjengset)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

jonhoo commented 1 year ago

Was it intentional that you also made changes to the flamegraph submodule?

mrob95 commented 1 year ago

Was it intentional that you also made changes to the flamegraph submodule?

Whoops, nope. Reverted that. To be honest I had forgotten about this PR!

jonhoo commented 1 year ago

Heh, yeah, sorry, I've been falling really behind on OSS stuff!

mrob95 commented 1 year ago

BTW, you may be glad to hear that inferno helped us track down and report an O(n^2) in boto3 :)

jonhoo commented 1 year ago

Published in 0.11.11 :tada: