WebsockexNova.Defaults.DefaultMetricsCollector (WebsockexNova v0.1.1)
View SourceDefault implementation of the MetricsCollector behavior for WebsockexNova.
Subscribes to all relevant telemetry events and aggregates metrics in ETS tables. Provides a public API for querying metrics (for testing/demo purposes).
All metrics handler API now uses the canonical WebsockexNova.ClientConn struct, with metrics-specific state in the :metrics field.
Metrics Tracked
- Connection statistics (open/close counts, durations)
- Message throughput (sent/received count, size, latency)
- Error metrics (count by category)
Usage
# Start the collector (normally done in your supervision tree)
WebsockexNova.Defaults.DefaultMetricsCollector.start_link([])
# Query metrics (for testing/demo)
WebsockexNova.Defaults.DefaultMetricsCollector.get_metric(:connections_opened)
Summary
Functions
Returns a specification to start this module under a supervisor.
Get a metric by key (for testing/demo).
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Get a metric by key (for testing/demo).