Skip to content

Commit

Permalink
Add metric to count failed setCC attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodauria committed Jan 22, 2024
1 parent 93c9e20 commit 4d999f8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ var (
},
[]string{"direction", "status"},
)
congestionControlErrors = promauto.NewCounterVec(
prometheus.CounterOpts{
Namespace: "msak",
Subsystem: "throughput1",
Name: "congestion_control_errors_total",
Help: "Number of attempts to set congestion control algorithm that resulted in an error.",
},
[]string{"cc"},
)
fileWrites = promauto.NewCounterVec(
prometheus.CounterOpts{
Namespace: "msak",
Expand Down Expand Up @@ -203,6 +212,7 @@ func (h *Handler) upgradeAndRunMeasurement(kind model.TestDirection, rw http.Res
if requestCC != "" {
err = conn.SetCC(requestCC)
if err != nil {
congestionControlErrors.WithLabelValues(requestCC).Inc()
log.Info("Failed to set cc", "ctx", fmt.Sprintf("%p", req.Context()),
"source", wsConn.RemoteAddr(),
"cc", requestCC, "error", err)
Expand Down

0 comments on commit 4d999f8

Please sign in to comment.