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

Lower level API to flamegraph renderer #270

Open
stepancheg opened this issue Oct 19, 2022 · 1 comment
Open

Lower level API to flamegraph renderer #270

stepancheg opened this issue Oct 19, 2022 · 1 comment

Comments

@stepancheg
Copy link

Current API only accepts strings.

Would be helpful if it could accept something like:

struct Tree {
  value_excluding_children: u64,
  label: String,
  subtrees: Vec<Tree>,
  node_type: NodeType, // kernel, library, ...
  ...
}

When flamegraph is generated programmatically, converting to string and back makes code less type safe (e.g. strings may be not escaped correctly).

But eventually API could be evolved to provide more detailed information. In particular, in out setup we measure both number of bytes and number of chunks.

Such API can be extended to provide labels to nodes. So it would still take value_excluding_children to compute width, but Tree could have additional node like extra: String which would be shown when clicked, and we could place number of chunks or any other text info into that extra field.

@jonhoo
Copy link
Owner

jonhoo commented Oct 22, 2022

It's a good idea! This is basically a duplicate of #164, which in turn really comes down to #30. It's something I would love for us to add, but that I also don't have the spare cycles to implement myself at the moment 😅 If you want to take it on though, please do!

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

No branches or pull requests

2 participants