RFR: 7198: Add websocket server that pushes data on selection updates [v12]

Alex Ciminian duke at openjdk.java.net
Mon Nov 29 12:04:23 UTC 2021


> This PR adds a websocket server that pushes event data as JSON to all connected clients whenever the user updates their current selection in JMC. The server is disabled by default and can be enabled and disabled from JMC preferences. This is a rework of the proof-of-concept code in https://github.com/openjdk/jmc/pull/225 and uses the JSON serialiser introduced in #279.
> 
> <img width="714" alt="Screenshot 2021-11-27 at 21 13 54" src="https://user-images.githubusercontent.com/348973/143722590-949ad362-6486-4f96-bae0-0fc9afcd7002.png">
> 
> The three endpoints available on the server are:
> 
> * `/events/` - raw serialised events
> * `/tree/` - `StacktraceTreeModel`, data used in the flame graph view
> * `/graph/` - `StacktraceGraphModel`, data used in the graph view
> 
> Please see [this Observable collection](https://observablehq.com/collection/@cimi/java-mission-control) for examples on how to connect.
> 
> This PR adds several new dependencies:
> * **org.eclipse.jetty.websocket:websocket-jetty-server:10.0.5**
> * **org.eclipse.jetty.websocket:websocket-javax-server:10.0.5**
> * **org.eclipse.jetty.websocket:websocket-jetty-api:10.0.5**
> * **org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle:1.34**
> 
> After adding the new dependencies, I had issues with resolving transitive dependency conflicts (when I was trying to use Jetty 9.x) then with fixing the eclipse launcher - please see the comments for details.

Alex Ciminian has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 21 commits:

 - Merge branch 'master' into cimi/websocket-server
 - Update full name
 - Merge branch 'master' into cimi/websocket-server
 - Add additional asm and asm.tree plugins to eclipse launchers
 - Fix websocket UI messages and copyright notices
 - Use CopyOnWriteArrayList for websocket handlers; remove useless cast
 - Fix copyright statememnts: remove Datadog in existing files, use year ranges
 - Remove 2019-12 platform definition, leftover after rebase
 - Add tree and graph handlers to websocket server
 - Revert whitespace changes in core/features.xml
 - ... and 11 more: https://git.openjdk.java.net/jmc/compare/4d1c087b...5f544a36

-------------

Changes: https://git.openjdk.java.net/jmc/pull/306/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jmc&pr=306&range=11
  Stats: 511 lines in 19 files changed: 460 ins; 0 del; 51 mod
  Patch: https://git.openjdk.java.net/jmc/pull/306.diff
  Fetch: git fetch https://git.openjdk.java.net/jmc pull/306/head:pull/306

PR: https://git.openjdk.java.net/jmc/pull/306


More information about the jmc-dev mailing list