diff options
| author | bndw <ben@bdw.to> | 2026-02-15 17:10:49 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-15 17:10:49 -0800 |
| commit | 4909a9f9d23ad969a03676d87087c1edad632a5d (patch) | |
| tree | 6d05615f626c6a239fe9888410e450f3881a3e09 /internal/handler/websocket/handler_test.go | |
| parent | fa8b4bb939430ba9c48fb4d3ba2b0e9095e229d3 (diff) | |
fix: track rate limit hits in metrics
- Added RecordRateLimitHit to MetricsRecorder interface
- Call RecordRateLimitHit when EVENT or REQ is rate limited
- Allows dashboard to show accurate rate limiting statistics
- Previously rate limits were applied but not tracked
Diffstat (limited to 'internal/handler/websocket/handler_test.go')
| -rw-r--r-- | internal/handler/websocket/handler_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/handler/websocket/handler_test.go b/internal/handler/websocket/handler_test.go index 604a190..2ef72fd 100644 --- a/internal/handler/websocket/handler_test.go +++ b/internal/handler/websocket/handler_test.go | |||
| @@ -98,6 +98,7 @@ func (m *mockMetrics) RecordRequest(method, status string, duration float64) { | |||
| 98 | m.requests[key]++ | 98 | m.requests[key]++ |
| 99 | } | 99 | } |
| 100 | func (m *mockMetrics) RecordAuthAttempt(success bool) {} | 100 | func (m *mockMetrics) RecordAuthAttempt(success bool) {} |
| 101 | func (m *mockMetrics) RecordRateLimitHit(authenticated bool) {} | ||
| 101 | func (m *mockMetrics) RecordBlockedEvent(kind int32) { | 102 | func (m *mockMetrics) RecordBlockedEvent(kind int32) { |
| 102 | m.mu.Lock() | 103 | m.mu.Lock() |
| 103 | defer m.mu.Unlock() | 104 | defer m.mu.Unlock() |
