toIDKey converts a string-based LabelKey to an int-based IDLabelKey. Returns false if either name or value is not found in the caches.
(key LabelKey)
| 85 | // toIDKey converts a string-based LabelKey to an int-based IDLabelKey. |
| 86 | // Returns false if either name or value is not found in the caches. |
| 87 | func (l *label) toIDKey(key LabelKey) (IDLabelKey, bool) { |
| 88 | nameID, ok := l.labelName.GetIDByName(key.Name) |
| 89 | if !ok { |
| 90 | return IDLabelKey{}, false |
| 91 | } |
| 92 | valueID, ok := l.labelValue.GetIDByValue(key.Value) |
| 93 | if !ok { |
| 94 | return IDLabelKey{}, false |
| 95 | } |
| 96 | return IDLabelKey{NameID: nameID, ValueID: valueID}, true |
| 97 | } |
| 98 | |
| 99 | // GetKeyToID returns a snapshot of all labels as string-based LabelKey map. |
| 100 | // This is an infrequent operation (debug, full assembly); it converts |