node-clinic-flame icon indicating copy to clipboard operation
node-clinic-flame copied to clipboard

[PARKED] Highlight all the occurrences for the selected frame

Open cuginoAle opened this issue 7 years ago • 5 comments

This PR won't be merged but we'll keep it as a proof of concept

This PR allows the user to quickly see how many other occurrences of the selected function are displayed in the graph. When hovering over a frame, the new component (sitting just next to the selection-controls) shows the number of other occurrences of the hovered frame, as well as the total % of the time spent by the function. Clicking on the button triggers an overlay (tooltip) containing the list of all the other occurrences (not including the selected frame) and the % of time spent running them.

On hover, the corresponding frame on the graph gets highlighted. On click, the corresponding frame on the graph gets selected

screenshot 2019-01-25 at 16 25 50

cuginoAle avatar Jan 22 '19 10:01 cuginoAle

Maybe we can do the highlighting in renderFrame() on the canvas instead? this method could set a property on the frame objects and renderFrame() can check it. then it would automagically work with animations and stuff (and it should be very performant even if there are hundreds/thousands of occurrences)

Absolutely

cuginoAle avatar Jan 23 '19 15:01 cuginoAle

latest demo: https://upload.clinicjs.org/public/0bc43b6532617aaafe2bf2906c7b28c5c5ba3353a5f3cdb5c85f03f18b9231db/5759.clinic-flame.html#selectedNode=3057&zoomedNode=&exclude=3c0&showOccurrences=true

cuginoAle avatar Jan 28 '19 17:01 cuginoAle

Great work, very interesting. It's great to be able to explore how common multiple occurrences are.

As discussed last week the UX needs some refining so it's a bit less surprising - will experiment with this and make some suggestions. Really awesome to be able to explore the possibilities like this.

My first thought is to maybe only show the same occurrences on the flamegraph strongly on selecting a frame, so there's a bit less noise while hovering around, and to use a subtle background and/or a little marker triangle in the corner rather than strong outlines, but it needs some experimentation.

AlanSl avatar Jan 29 '19 09:01 AlanSl

This dropdown is super cool. My first thoughts from playing with this are similar; the outline can be hard to see so a light background similar to what the search does may be better (and there's precedent for it, so)

I feel like one option for the button/dropdown combo is to split it up, the dropdown can still be useful even if other occurences aren't being highlighted right now.

I'd perhaps also like to see the dropdown labelled with something like '16 occurences' instead of just '16' to clarify what it's for without having to hover, if that doesn't take too much space

goto-bus-stop avatar Jan 29 '19 10:01 goto-bus-stop

This PR won't be merged but we'll keep it as a proof of concept

cuginoAle avatar Feb 22 '19 08:02 cuginoAle