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

Function getLabelsString

pkg/util/metrics_helper.go:396–408  ·  view source on GitHub ↗
(labelValues []string)

Source from the content-addressed store, hash-verified

394}
395
396func getLabelsString(labelValues []string) string {
397 // Get a buffer from the pool, reset it and release it at the
398 // end of the function.
399 buf := bytesBufferPool.Get().(*bytes.Buffer)
400 buf.Reset()
401 defer bytesBufferPool.Put(buf)
402
403 for _, v := range labelValues {
404 buf.WriteString(v)
405 buf.WriteByte(0) // separator, not used in prometheus labels
406 }
407 return buf.String()
408}
409
410// sum returns sum of values from all metrics from same metric family (= series with the same metric name, but different labels)
411// Supplied function extracts value.

Callers 2

getMetricsWithLabelNamesFunction · 0.85

Calls 5

WriteStringMethod · 0.80
GetMethod · 0.65
PutMethod · 0.65
StringMethod · 0.65
ResetMethod · 0.45

Tested by 1