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

Analyzes event patterns and sequences across timeline.

Detects:
- Duplicate consecutive events (unnecessary re-renders)
- Excessive event counts (>10 of same event)
- Common event sequences (repeated patterns)
- Optimization opportunities (debouncing, throttling)

## Algorithm

1. Track event frequencies
2. Detect consecutive duplicates (3+ same events in a row)
3. Detect excessive events (>10 total of same type)
4. Identify common sequences (2+ event patterns)
5. Suggest optimizations based on patterns

## Output

Returns findings and statistics:

    %{
      findings: [
        %{
          severity: :warning,
          message: "3 consecutive 'handle_event:filter' events - may indicate unnecessary re-renders",
          events: [2, 3, 4],
          metadata: %{event_type: "handle_event:filter", count: 3}
        }
      ],
      stats: %{
        event_counts: %{"mount" => 1, "handle_event:filter" => 5},
        most_common_event: "handle_event:filter",
        common_sequences: [["mount", "handle_event:filter", "handle_event:sort"]]
      }
    }

# `analyze`

# `default_enabled?`

# `name`

# `requires_enrichers`

---

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