(key LabelKey)
| 125 | } |
| 126 | |
| 127 | func (l *label) GetIDByKey(key LabelKey) (int, bool) { |
| 128 | idk, ok := l.toIDKey(key) |
| 129 | if !ok { |
| 130 | return 0, false |
| 131 | } |
| 132 | |
| 133 | if item, ok := l.getActive()[idk]; ok { |
| 134 | return item, true |
| 135 | } |
| 136 | |
| 137 | l.mu.RLock() |
| 138 | defer l.mu.RUnlock() |
| 139 | if item, ok := l.pending[idk]; ok { |
| 140 | return item, true |
| 141 | } |
| 142 | return 0, false |
| 143 | } |
| 144 | |
| 145 | func (l *label) Add(batch []*controller.PrometheusLabel) { |
| 146 | l.mu.Lock() |