Excessibility.TelemetryCapture.Analyzers.MessageFlooding (Excessibility v0.17.0)

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, but Phoenix LiveView does not emit handle_info telemetry and the capture layer does not hook it, so nothing populates those events yet (issue #147). It is therefore not in the default set — enabling it would imply working coverage while staying silent. Enable it explicitly once handle_info capture lands.

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

analyze(map, opts)

Callback implementation for Excessibility.TelemetryCapture.Analyzer.analyze/2.

default_enabled?()

Callback implementation for Excessibility.TelemetryCapture.Analyzer.default_enabled?/0.

name()

Callback implementation for Excessibility.TelemetryCapture.Analyzer.name/0.

requires_enrichers()

Callback implementation for Excessibility.TelemetryCapture.Analyzer.requires_enrichers/0.