MCPcopy
hub / github.com/redis/go-redis / validateMetrics

Function validateMetrics

extra/redisotel-native/metrics_stress_test.go:129–148  ·  view source on GitHub ↗
(t *testing.T, rm metricdata.ResourceMetrics)

Source from the content-addressed store, hash-verified

127}
128
129func validateMetrics(t *testing.T, rm metricdata.ResourceMetrics) {
130 metricsFound := make(map[string]bool)
131 for _, sm := range rm.ScopeMetrics {
132 for _, m := range sm.Metrics {
133 metricsFound[m.Name] = true
134 }
135 }
136
137 required := []string{
138 MetricConnectionCount,
139 MetricConnectionCreateTime,
140 MetricOperationDuration,
141 }
142
143 for _, name := range required {
144 if !metricsFound[name] {
145 t.Errorf("Required metric not found: %s", name)
146 }
147 }
148}
149
150func resetObservabilityForTest() {
151 observabilityInstanceOnce = sync.Once{}

Callers 1

TestMetricsUnderStressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected