Integrated: 7198: Add websocket server that pushes data on selection updates

Alex Ciminian duke at openjdk.java.net
Mon Nov 29 13:12:15 UTC 2021


On Thu, 9 Sep 2021 16:32:58 GMT, Alex Ciminian <duke at openjdk.java.net> wrote:

> 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.

This pull request has now been integrated.

Changeset: ca204424
Author:    Alex Ciminian <alexandru.ciminian at datadoghq.com>
Committer: Marcus Hirt <hirt at openjdk.org>
URL:       https://git.openjdk.java.net/jmc/commit/ca204424ce32336f2923aff66f619d571b1fc720
Stats:     511 lines in 19 files changed: 460 ins; 0 del; 51 mod

7198: Add websocket server that pushes data on selection updates

Reviewed-by: hirt, aptmac

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

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


More information about the jmc-dev mailing list