RFR: 7451: Add heat map view [v2]
Alex Ciminian
duke at openjdk.java.net
Tue Nov 30 22:20:34 UTC 2021
> This PR adds a new plugin (`flightrecorder.heatmap`) which renders a visualisation similar to the one in [this Observable notebook](https://observablehq.com/@cimi/jfr-heatmap).
>
> The code is simpler than both the flame view and the graph view, because of less rendering options and less dependencies - the heatmap only requires d3 and currently does not support any user configuration.
>
> Each cell represents 100 milliseconds from the recording. We decided to automatically adjust the size of the cell so that the entire heatmap fits inside the window. This is different from the observable notebook which ensured each row represented 6s (i.e. it had a fixed number of 60 columns). The auto-sizing seems to work well with both small and large recordings, although we lose consistency when we resize the window and some periodic patterns are no longer visible when we vary the number of columns.
>
> I still have some TODOs to take care of (see below) but the code is ready for a first-pass review
>
> - [x] Add/fix copyright notices
> - [x] Ensure axes are always visible (when cells are very large sometimes the axes get cut off)
> - [x] Ensure minimum cell size - now the heatmap disappears if the window is too small (i.e. computed cell size is < 1px).
> - [x] Add a title to the chart? ('Showing `x` events collected between `tStart` and `tEnd`'?)
> - [ ] Display a colour legend (like we have in the notebook) and some indicator that a cell represents 100ms
> - [x] Display 'no-data' message or banner when the selection is empty
> - [x] Display error message when rendering the heatmap fails? (this should be unlikely)
>
> 
>
> 
Alex Ciminian has updated the pull request incrementally with six additional commits since the last revision:
- Add right margin to prevent horizontal scroll
- Add 'no data' message to heatmap
- Add heatmap title with event count and start end time
- Remove right margin, fix axes misalignment
- Set minimum heatmap cell size to 4px
- Fix copyright notices
-------------
Changes:
- all: https://git.openjdk.java.net/jmc/pull/337/files
- new: https://git.openjdk.java.net/jmc/pull/337/files/3c71b4b2..f6286af5
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jmc&pr=337&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jmc&pr=337&range=00-01
Stats: 318 lines in 6 files changed: 117 ins; 78 del; 123 mod
Patch: https://git.openjdk.java.net/jmc/pull/337.diff
Fetch: git fetch https://git.openjdk.java.net/jmc pull/337/head:pull/337
PR: https://git.openjdk.java.net/jmc/pull/337
More information about the jmc-dev
mailing list