# `Excessibility.TelemetryCapture.Analyzers.MessageFlooding`
[🔗](https://github.com/lessthanseventy/excessibility/blob/v0.18.1/lib/telemetry_capture/analyzers/message_flooding.ex#L1)

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 {: .warning}
>
> 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}}
    }

# `analyze`

# `default_enabled?`

# `name`

# `requires_enrichers`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
