Change summary
frontend/src/pages/game.tsx | 2 +-
internal/server/metrics.go | 7 +++++++
internal/server/server.go | 1 +
3 files changed, 9 insertions(+), 1 deletion(-)
Detailed changes
@@ -56,7 +56,7 @@ function usePlayer(playerID: string, state?: State): { pState: StatePlayer; pTea
}, [playerID, state]);
}
-const reconnectAttempts = 5;
+const reconnectAttempts = 2;
function useWS(roomID: string, playerID: string, nickname: string, dead: () => void, onOpen: () => void) {
const didUnmount = React.useRef(false);
@@ -33,4 +33,11 @@ var (
Name: "sent_total",
Help: "Total number of sent messages.",
})
+
+ metricHandleErrors = promauto.NewCounter(prometheus.CounterOpts{
+ Namespace: "codies",
+ Subsystem: "codies",
+ Name: "handle_error_total",
+ Help: "Total number of handle errors.",
+ })
)
@@ -297,6 +297,7 @@ func (r *Room) HandleConn(playerID uuid.UUID, nickname string, c *websocket.Conn
metricReceived.Inc()
if err := r.handleNote(playerID, ¬e); err != nil {
+ metricHandleErrors.Inc()
log.Println("error handling note:", err)
return err
}