Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review histograms buckets #160

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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