-
Notifications
You must be signed in to change notification settings - Fork 217
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
pkg/query: Create flamegraph_arrow #3069
Conversation
pkg/query/flamegraph_arrow.go
Outdated
) | ||
|
||
const ( | ||
flamegraphFieldMappingStart = "mapping_start" |
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 wonder if we can make this code cleaner by having a map from field name to some struct that encapsulates the arrow type and holds a reference to the builder.
4d2f122
to
001fede
Compare
Next week, I'll bring this PR into a mergeable state. So we can make progress on smaller follow-up PRs. The follow ups on the Go side should be:
|
060cabc
to
375ee8c
Compare
7a8f26b
to
a2a06fe
Compare
There's one more fix I need to do in upstream Arrow (due to which the CI is going to fail here) |
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.
Nice work! Happy to merge this and iterate!
int32 height = 3; | ||
|
||
// trimmed is the amount of cumulative value trimmed from the flame graph. | ||
int64 trimmed = 4; |
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.
do we strictly need this?
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.
This is mostly used for debugging, otherwise, we don't really need it.
The new changes break the tests again. I'll fix those tomorrow. |
Additionally, we now update the root's row cumulative value and the end and correctly build the children lists.
…regating This has huge performance improvements due to not allocating strings when converting the bytes to string.
…prof labels This will allow users to specify if pprof labels should be ignored and aggregated away, or if the flame graph should consider their values and group by the once that are equal.
Also improve ergonomics by introducing isRoot, isLeaf and parent helper structs and funcs.
3829fde
to
9efa875
Compare
This creates a new flame graph representation. Instead of creating the flame graph with Go structs directly, we utilize Apache Arrow to create a record including the rows of each location.
The way the arrow schema looks can be viewed in
pkg/query/flamegraph_arrow.go
andpkg/query/flamegraph_arrow_test.go
contains an example of what we currently have.The API currently doesn't expose this type just yet. Only the enum type was added to proto to be able to call
RenderReport
withQueryRequest_REPORT_TYPE_FLAMEGRAPH_ARROW
.