-
Notifications
You must be signed in to change notification settings - Fork 48
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
A grabbag of random fixes #212
Conversation
Codecov Report
@@ Coverage Diff @@
## master #212 +/- ##
==========================================
+ Coverage 81.48% 82.11% +0.63%
==========================================
Files 9 9
Lines 1118 1124 +6
==========================================
+ Hits 911 923 +12
+ Misses 207 201 -6
Continue to review full report at Codecov.
|
4b54d97
to
fb4c0aa
Compare
@@ -905,8 +911,8 @@ The empty horizontal periods in the flamegraph correspond to times when somethin | |||
The total width of the flamegraph is set from the `ROOT` node. | |||
""" | |||
function FlameGraphs.flamegraph(tinf::InferenceTimingNode; tmin = 0.0, excluded_modules=Set([Main::Module]), mode=nothing) | |||
isROOT(tinf) && isempty(tinf.children) && error("root node has no children") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timholy I just hit this error in usage of this package..
It seems to me that it's much better to just return an otherwise empty profile, with just the single ROOT node.
From what i can tell, without this check, it does return that empty profile correctly.
Can we remove this line? I'm curious if you remember the motivation to add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't. I guess I was thinking the error explained what was going on, whereas a blank ProfileView window might just be confusing. For me the usual invocation is ProfileView.view(flamegraph(tinf))
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very happy to have you change this though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense. I think i was thinking that if it's empty, then it's empty! 😅 But you're right that it's not as nice as if it said "hey this is empty."
Maybe we can print a warning instead of throwing an error?
Our use case is that we're creating this via an HTTP endpoint on prod servers now (!!), and i don't want that to throw an error and return a 500:
JuliaPerf/ProfileEndpoints.jl#16
K, thanks, i'll send a quick PR
These are things I fixed while using this in practice. Unfortunately I don't have tests for them (bad, bad), I guess when I encountered them in practice I felt it was important to keep moving.
Better to have them than not, I think.