| 394 | } |
| 395 | |
| 396 | func 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. |