jonhoo / inferno

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

Filter out lines which begin with '# ' in inferno-flamegraph #239

Closed mrob95 closed 2 years ago

mrob95 commented 2 years ago

implements #237

also fixes #238 by moving the check for empty/ignored lines out of merge and into from_lines. I think this makes more sense as the block in from_lines which handles opt.reverse_stack_order pre-processes the samples before calling merge, and seems to assume that the lines it deals with are not empty. I'm not very experienced with rust though, so please let me know if there is a better way!

I've added an empty line to the bad-lines test file as a regression test for #238, and a couple of test files for input from the austin profiler.

codecov[bot] commented 2 years ago

Codecov Report

Merging #239 (8d4cf04) into master (29fb054) will increase coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #239      +/-   ##
==========================================
+ Coverage   87.17%   87.21%   +0.04%     
==========================================
  Files          18       18              
  Lines        2526     2527       +1     
==========================================
+ Hits         2202     2204       +2     
+ Misses        324      323       -1     
Impacted Files Coverage Δ
src/flamegraph/merge.rs 87.23% <ø> (+0.77%) :arrow_up:
src/flamegraph/mod.rs 87.03% <100.00%> (+0.13%) :arrow_up:

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 29fb054...8d4cf04. Read the comment docs.

jonhoo commented 2 years ago

Thanks! I'll fix the MSRV issue separately — that's not caused by your change.

jonhoo commented 2 years ago

Published as 0.11.3 :tada:

mrob95 commented 2 years ago

Awesome! Thanks 😊