MCPcopy Index your code
hub / github.com/coder/coder / getMetricLabels

Function getMetricLabels

coderd/httpmw/prometheus_test.go:210–222  ·  view source on GitHub ↗
(metrics []*cm.MetricFamily)

Source from the content-addressed store, hash-verified

208}
209
210func getMetricLabels(metrics []*cm.MetricFamily) map[string]map[string]string {
211 metricLabels := map[string]map[string]string{}
212 for _, metricFamily := range metrics {
213 metricName := metricFamily.GetName()
214 metricLabels[metricName] = map[string]string{}
215 for _, metric := range metricFamily.GetMetric() {
216 for _, labelPair := range metric.GetLabel() {
217 metricLabels[metricName][labelPair.GetName()] = labelPair.GetValue()
218 }
219 }
220 }
221 return metricLabels
222}

Callers 1

TestPrometheusFunction · 0.85

Calls 2

GetNameMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected