summaryrefslogtreecommitdiffstats
path: root/internal/handler/websocket/handler_test.go
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-02-15 17:10:49 -0800
committerbndw <ben@bdw.to>2026-02-15 17:10:49 -0800
commit4909a9f9d23ad969a03676d87087c1edad632a5d (patch)
tree6d05615f626c6a239fe9888410e450f3881a3e09 /internal/handler/websocket/handler_test.go
parentfa8b4bb939430ba9c48fb4d3ba2b0e9095e229d3 (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.go1
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}
100func (m *mockMetrics) RecordAuthAttempt(success bool) {} 100func (m *mockMetrics) RecordAuthAttempt(success bool) {}
101func (m *mockMetrics) RecordRateLimitHit(authenticated bool) {}
101func (m *mockMetrics) RecordBlockedEvent(kind int32) { 102func (m *mockMetrics) RecordBlockedEvent(kind int32) {
102 m.mu.Lock() 103 m.mu.Lock()
103 defer m.mu.Unlock() 104 defer m.mu.Unlock()