get cpu stats from cgroup, remove env (#2636)

* get cpu stats from cgroup, remove env

* undo rand seed removal

* tests
This commit is contained in:
Mathew Kamkar
2024-04-08 21:15:17 -07:00
committed by GitHub
parent 196fed605e
commit 10c8582a6b
11 changed files with 61 additions and 52 deletions
+4 -4
View File
@@ -26,26 +26,26 @@ var (
qualityDrop *prometheus.CounterVec
)
func initQualityStats(nodeID string, nodeType livekit.NodeType, env string) {
func initQualityStats(nodeID string, nodeType livekit.NodeType) {
qualityRating = prometheus.NewHistogram(prometheus.HistogramOpts{
Namespace: livekitNamespace,
Subsystem: "quality",
Name: "rating",
ConstLabels: prometheus.Labels{"node_id": nodeID, "node_type": nodeType.String(), "env": env},
ConstLabels: prometheus.Labels{"node_id": nodeID, "node_type": nodeType.String()},
Buckets: []float64{0, 1, 2},
})
qualityScore = prometheus.NewHistogram(prometheus.HistogramOpts{
Namespace: livekitNamespace,
Subsystem: "quality",
Name: "score",
ConstLabels: prometheus.Labels{"node_id": nodeID, "node_type": nodeType.String(), "env": env},
ConstLabels: prometheus.Labels{"node_id": nodeID, "node_type": nodeType.String()},
Buckets: []float64{1.0, 2.0, 2.5, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5},
})
qualityDrop = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: livekitNamespace,
Subsystem: "quality",
Name: "drop",
ConstLabels: prometheus.Labels{"node_id": nodeID, "node_type": nodeType.String(), "env": env},
ConstLabels: prometheus.Labels{"node_id": nodeID, "node_type": nodeType.String()},
}, []string{"direction"})
prometheus.MustRegister(qualityRating)