Breeze.Server.Diagnostics (Breeze v0.4.0)

Copy Markdown View Source

Developer-facing diagnostics for a running Breeze server.

Use this module to read the latest rendering statistics or inspector state, and to subscribe a process to either stream. Subscribers are monitored and automatically removed when they exit.

Statistics subscribers receive {:debug_stats, stats} messages. Inspector subscribers receive {:inspector_snapshot, snapshot} messages.

Summary

Functions

Returns the latest inspector snapshot for a server.

Returns the latest rendering and interaction statistics for a server.

Subscribes a process to inspector snapshots.

Subscribes a process to rendering and interaction statistics.

Functions

inspector_snapshot(server)

@spec inspector_snapshot(pid()) :: map()

Returns the latest inspector snapshot for a server.

stats(server)

@spec stats(pid()) :: map()

Returns the latest rendering and interaction statistics for a server.

subscribe_inspector(server, subscriber \\ self())

@spec subscribe_inspector(pid(), pid()) :: :ok

Subscribes a process to inspector snapshots.

The subscriber receives {:inspector_snapshot, snapshot} whenever the server publishes an updated snapshot. It defaults to the calling process.

subscribe_stats(server, subscriber \\ self())

@spec subscribe_stats(pid(), pid()) :: :ok

Subscribes a process to rendering and interaction statistics.

The subscriber receives {:debug_stats, stats} whenever the server publishes an updated snapshot. It defaults to the calling process.