Skip to content

[TypeScript] Add WebSocket reconnect metrics (#73) - #116

Open
cwjcwj95 wants to merge 1 commit into
jaxassistant55:mainfrom
cwjcwj95:fix/ws-reconnect-metrics-1782144707
Open

[TypeScript] Add WebSocket reconnect metrics (#73)#116
cwjcwj95 wants to merge 1 commit into
jaxassistant55:mainfrom
cwjcwj95:fix/ws-reconnect-metrics-1782144707

Conversation

@cwjcwj95

Copy link
Copy Markdown

Summary

Adds reconnect metrics tracking to the useWebSocket hook as requested in #73.

Changes

  • Added WebSocketMetrics interface tracking:
    • connects: Total successful connections
    • disconnects: Total disconnections
    • reconnects: Total reconnection attempts
    • errors: Total errors
    • lastConnectedAt: Timestamp of last connection
    • lastDisconnectedAt: Timestamp of last disconnection
  • Metrics exposed via metrics property from useWebSocket()
  • Zero breaking changes to existing API

Testing

  • Verified TypeScript compilation
  • Metrics correctly increment on connect/disconnect/reconnect/error events

Closes #73

- Track connect/disconnect/reconnect/error counts
- Track timestamps for last connect/disconnect
- Expose metrics via useWebSocket hook
- Maintains backward compatibility

Closes #73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[$25 BOUNTY] [TypeScript] Add reconnect metrics for frontend sockets

1 participant