Understanding LiveView Telemetry Events for Load/Performance Testing w/ Artillery and Playwright

Hello!

We’re gearing up to test our LiveView application with Playwright and Artillery. We’re planning on really pushing the limits of our application and liveview specifically. We’d love to better monitor the number of liveview updates and server response times over WebSockets.

Unfortunately, I didn’t see anywhere that Phoenix LiveView expenses web socket frames or payload size aggregates, but I did see that it exposed some Telemetry I could use as proxies. Telemetry — Phoenix LiveView v0.20.14

What’s the best proxy to use? It seems that [:phoenix, :live_view, :render, :stop] is my best bet and includes a duration. Or Am I mistaken? I would have imagined that render would not include the entire time that LiveView needs to handle the response, just the time spent in the render. For example, I would have imagined that handle_params (which has its own telemetry events) or handle_event would get called first and then pass its results and call render.

Any insights are appreciated. Thanks in advance!


P.S. If you are also thinking about implementing e2e testing or load testing with liveview, check out the e2e tests in the main Phoenix library here: phoenix_live_view/test/e2e at main · phoenixframework/phoenix_live_view · GitHub

I’m working on a proposal to introduce telemetry events for liveview clients, I have a prototype made for JS to send error and sourced map stacktrace to the socket, that would be expanded to general telemetry events that we know today, LVN is not ready yet, I wanted to drive the proposal with actual working POC for both.

There has been prior art to expand events:
https://elixirforum.com/t/feature-idea-measure-and-expose-socket-latency/46050 https://elixirforum.com/t/more-telemetry-events-for-liveview/59388/4

And this is my POC: Add ErrorChannel · Schultzer/phoenix_live_view@ddde333 · GitHub

1 Like