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

add flame chart mode #125

Merged
merged 5 commits into from
Jun 20, 2020
Merged

Conversation

AnderEnder
Copy link
Contributor

Closes #23

@codecov-io
Copy link

codecov-io commented Apr 23, 2019

Codecov Report

Merging #125 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
+ Coverage   90.27%   90.30%   +0.02%     
==========================================
  Files          16       16              
  Lines        2232     2238       +6     
==========================================
+ Hits         2015     2021       +6     
  Misses        217      217              
Impacted Files Coverage Δ
src/flamegraph/merge.rs 94.79% <100.00%> (+0.05%) ⬆️
src/flamegraph/mod.rs 96.46% <100.00%> (+0.06%) ⬆️

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 0bf9331...c122c14. Read the comment docs.

@jonhoo
Copy link
Owner

jonhoo commented Apr 26, 2019

I haven't forgotten about this, but would like to see the response to #23 (comment) first, as I think it means that these charts don't actually turn out useful.

@jonhoo
Copy link
Owner

jonhoo commented Jun 15, 2020

Wow, sorry, I dropped the ball on this even though the referenced comment has now seen some further discussion! I still wonder if it'd be useful to have a "non-collapsing" folder that just turns stacks into the right line format for the flamegraph tool to consume, but I think this is useful even without that (and such a tool should probably be a separate PR anyway). Let me update my review of this, and hopefully we should be able to land this without too much trouble!

src/flamegraph/mod.rs Outdated Show resolved Hide resolved
@jonhoo
Copy link
Owner

jonhoo commented Jun 16, 2020

@That3Percent want to give this PR a shot and see whether it produces the kind of output you're after?

@That3Percent
Copy link

I gave this a try and got an error: Io(Custom { kind: InvalidData, error: "unsorted input lines detected" })

Using options:

let mut options = flamegraph::Options {
        count_name: "ns".to_owned(),
        hash: true,
        flame_chart: true,
        ..Default::default()
    };

And the following data, which I hope is correct:
flames.txt

@jonhoo
Copy link
Owner

jonhoo commented Jun 18, 2020

Ohh, interesting, yeah, that error will definitely need to be suppressed for a flame chart. @AnderEnder it's here:

if prev_line > line {
return Err(quick_xml::Error::Io(io::Error::new(
io::ErrorKind::InvalidData,
"unsorted input lines detected",
)));
}

We'll want that check to be disabled if flamechart mode is on.

@jonhoo
Copy link
Owner

jonhoo commented Jun 20, 2020

@That3Percent The latest commit should at least not fail with that error — care to try again?

@AnderEnder
Copy link
Contributor Author

@jonhoo and @That3Percent,

I added a condition to frames. And result is produced for your example: flame.svg

@That3Percent
Copy link

I gave this a try and I'm really happy with the result. This is now much better than the flame graph that flame produces because the bars line up with the actual time within the method that an event occurred rather than shifting to fill any gaps. Great! This retains a lot of useful information.

Once this makes it into a release on crates.io I'll include it in firestorm and do a proper release of that with docs and the full treatment.

@jonhoo
Copy link
Owner

jonhoo commented Jun 20, 2020

@That3Percent Excellent, glad to hear it! Should be ready for release in not too long.

@AnderEnder Could you include the provided input file and the produced output file as a test case? If you get stuck, @jasonrhansen may be able to give you some pointers too. Once we have that, I think this is good to land!

@jonhoo
Copy link
Owner

jonhoo commented Jun 20, 2020

Oh, and an update to the CHANGELOG please!

@That3Percent
Copy link

@AnderEnder Attached is a new input file. there were some minor issues with the last one (when I was removing entries that had 0 time, it was possible to have adjacent stacks with the same name that were actually the same stack).

flames.txt

@AnderEnder
Copy link
Contributor Author

@jonhoo, done. Should commit "make func_frameattrs atribute contidional" be removed from this PR?

@jonhoo jonhoo merged commit e4d7e34 into jonhoo:master Jun 20, 2020
@jonhoo
Copy link
Owner

jonhoo commented Jun 20, 2020

Nope, all good, thanks!

@jonhoo
Copy link
Owner

jonhoo commented Jun 20, 2020

Released in 0.10.0.

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.

Flame chart mode
4 participants