(vals []string)
| 248 | } |
| 249 | |
| 250 | func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) { |
| 251 | if err := validateLabelValues(vals, len(m.desc.variableLabels.names)-len(m.curry)); err != nil { |
| 252 | return 0, err |
| 253 | } |
| 254 | |
| 255 | var ( |
| 256 | h = hashNew() |
| 257 | curry = m.curry |
| 258 | iVals, iCurry int |
| 259 | ) |
| 260 | for i := 0; i < len(m.desc.variableLabels.names); i++ { |
| 261 | if iCurry < len(curry) && curry[iCurry].index == i { |
| 262 | h = m.hashAdd(h, curry[iCurry].value) |
| 263 | iCurry++ |
| 264 | } else { |
| 265 | h = m.hashAdd(h, vals[iVals]) |
| 266 | iVals++ |
| 267 | } |
| 268 | h = m.hashAddByte(h, model.SeparatorByte) |
| 269 | } |
| 270 | return h, nil |
| 271 | } |
| 272 | |
| 273 | func (m *MetricVec) hashLabels(labels Labels) (uint64, error) { |
| 274 | if err := validateValuesInLabels(labels, len(m.desc.variableLabels.names)-len(m.curry)); err != nil { |
no test coverage detected