LabelsToKeyString is used to form a string to be used as the hashKey. Don't print, use l.String() for printing.
(l labels.Labels)
| 306 | // LabelsToKeyString is used to form a string to be used as |
| 307 | // the hashKey. Don't print, use l.String() for printing. |
| 308 | func LabelsToKeyString(l labels.Labels) string { |
| 309 | // We are allocating 1024, even though most series are less than 600b long. |
| 310 | // But this is not an issue as this function is being inlined when called in a loop |
| 311 | // and buffer allocated is a static buffer and not a dynamic buffer on the heap. |
| 312 | b := make([]byte, 0, 1024) |
| 313 | return string(l.Bytes(b)) |
| 314 | } |