MCPcopy Create free account
hub / github.com/cortexproject/cortex / makeLabels

Function makeLabels

pkg/util/metrics_helper_test.go:136–147  ·  view source on GitHub ↗
(namesAndValues ...string)

Source from the content-addressed store, hash-verified

134}
135
136func makeLabels(namesAndValues ...string) []*dto.LabelPair {
137 out := []*dto.LabelPair(nil)
138
139 for i := 0; i+1 < len(namesAndValues); i = i + 2 {
140 out = append(out, &dto.LabelPair{
141 Name: proto.String(namesAndValues[i]),
142 Value: proto.String(namesAndValues[i+1]),
143 })
144 }
145
146 return out
147}
148
149// TestSendSumOfGaugesPerUserWithLabels tests to ensure multiple metrics for the same user with a matching label are
150// summed correctly

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected