Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

2 changed files with 12 additions and 13 deletions

View File

@ -11,18 +11,18 @@ var (
Help: "Number of currently connected WebSocket clients",
})
MessagesTotal = promauto.NewGauge(prometheus.GaugeOpts{
Name: "websocket_message",
Help: "Number of WebSocket messages processed",
MessagesTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "websocket_messages_total",
Help: "Total number of WebSocket messages processed",
})
ConnectionsTotal = promauto.NewGauge(prometheus.GaugeOpts{
Name: "websocket_connection",
Help: "Number of WebSocket connections established",
ConnectionsTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "websocket_connections_total",
Help: "Total number of WebSocket connections established",
})
DisconnectionsTotal = promauto.NewGauge(prometheus.GaugeOpts{
Name: "websocket_disconnection",
Help: "Number of WebSocket disconnections",
DisconnectionsTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "websocket_disconnections_total",
Help: "Total number of WebSocket disconnections",
})
)

View File

@ -6,10 +6,9 @@ import (
"log"
"net/http"
"github.com/prometheus/client_golang/prometheus/promhttp"
"websocket-relay/internal/config"
"websocket-relay/internal/hub"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
@ -35,7 +34,7 @@ func main() {
}
mux := http.NewServeMux()
mux.HandleFunc("/", h.HandleWebSocket)
mux.HandleFunc("/ws", h.HandleWebSocket)
addr := fmt.Sprintf(":%d", cfg.Server.Port)
if cfg.Server.TLS.Enabled {