Excessibility. TelemetryCapture. Analyzers. MessageFlooding
(Excessibility v0.18.1)
Copy Markdown
View Source
Detects high-frequency handle_info message patterns.
LiveViews subscribing to PubSub or using timers can receive messages faster than useful, causing unnecessary processing and renders.
Opt-in
This analyzer reads handle_info:* timeline events. Phoenix LiveView emits
no handle_info telemetry, so those events are only captured when you opt
into the Excessibility.TelemetryCapture on_mount hook (issue #147) —
e.g. live_session :default, on_mount: [Excessibility.TelemetryCapture].
Because that wiring is opt-in, the analyzer is not in the default set
(a default-on analyzer with no hook would imply coverage while staying
silent). Enable it explicitly (--analyze=message_flooding or via config)
once the hook is wired.
Detection
- Sliding window: >10 same-name handle_info events within 200ms
- Total count: >20 of any single handle_info type
- Suggests debouncing, throttling, or increasing timer intervals
Output
%{
findings: [%{
severity: :warning,
message: "47 handle_info(:tick) events in 200ms...",
events: [1, 2, ..., 47],
metadata: %{event_type: "handle_info:tick", count: 47, window_ms: 200}
}],
stats: %{handle_info_counts: %{"handle_info:tick" => 47}}
}
Summary
Functions
Callback implementation for Excessibility.TelemetryCapture.Analyzer.analyze/2.
Callback implementation for Excessibility.TelemetryCapture.Analyzer.default_enabled?/0.
Callback implementation for Excessibility.TelemetryCapture.Analyzer.name/0.
Callback implementation for Excessibility.TelemetryCapture.Analyzer.requires_enrichers/0.
Functions
Callback implementation for Excessibility.TelemetryCapture.Analyzer.analyze/2.
Callback implementation for Excessibility.TelemetryCapture.Analyzer.default_enabled?/0.
Callback implementation for Excessibility.TelemetryCapture.Analyzer.name/0.
Callback implementation for Excessibility.TelemetryCapture.Analyzer.requires_enrichers/0.