Implement backend top table (self, total)
Is your feature request related to a problem? Please describe.
The UI currently derives the functions TOP table from the flame graph. As a result of truncation happening on the flame graph data (through maxNodes), the "self" top table might be containing significant parts of "other" resource usage.
Describe the solution you'd like
We should calculate the top k list on the backend for each self and total and return the TOP k elements separately to the flamegraph's data.
Alternatives
- Just don't display others in the top table.
- Detail what self usages others has, but don't keep the tree structure.
Additional context
I am still a bit unsure about, how tricky the mismatches between numbers on the table and the flamegraph are for users to comprehend. Also
@alsoba13 please take a look and add some more context, if you think I forgot something.
This is also slightly realted, but it improves how the flamegraph table shows others: https://github.com/grafana/grafana/issues/110677