Skip to content

Commit

Permalink
Review histograms buckets (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 authored Oct 10, 2024
1 parent a44d499 commit 2137f0c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions service/perf/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const (
metricsSubSystemWS = "ws"
)

var (
latencyBuckets = []float64{.001, .005, .0075, .01, .025, .05, .075, .1, .25, .3, .4, .5, .75, 1}
lossBuckets = []float64{.001, .005, .0075, .01, .025, .05, .075, .1, .25, .5, .75, 1}
)

type Metrics struct {
registry *prometheus.Registry

Expand Down Expand Up @@ -64,6 +69,7 @@ func NewMetrics(namespace string, registry *prometheus.Registry) *Metrics {
Subsystem: metricsSubSystemRTC,
Name: "rtp_tracks_writes_time",
Help: "Time taken to write to RTP tracks",
Buckets: latencyBuckets,
},
[]string{"groupID", "type"},
)
Expand Down Expand Up @@ -132,6 +138,7 @@ func NewMetrics(namespace string, registry *prometheus.Registry) *Metrics {
Subsystem: metricsSubSystemRTCClient,
Name: "loss_rate",
Help: "Client loss rate",
Buckets: lossBuckets,
},
[]string{"groupID"},
)
Expand All @@ -143,6 +150,7 @@ func NewMetrics(namespace string, registry *prometheus.Registry) *Metrics {
Subsystem: metricsSubSystemRTCClient,
Name: "rtt",
Help: "Client round trip time",
Buckets: latencyBuckets,
},
[]string{"groupID"},
)
Expand All @@ -154,6 +162,7 @@ func NewMetrics(namespace string, registry *prometheus.Registry) *Metrics {
Subsystem: metricsSubSystemRTCClient,
Name: "jitter",
Help: "Client latency jitter",
Buckets: latencyBuckets,
},
[]string{"groupID"},
)
Expand Down

0 comments on commit 2137f0c

Please sign in to comment.