| 56 | } |
| 57 | |
| 58 | func (v *CachedGaugeVec) WithLabelValues(operation VectorOperation, value float64, labelValues ...string) { |
| 59 | switch operation { |
| 60 | case VectorOperationAdd, VectorOperationSet: |
| 61 | default: |
| 62 | panic("unsupported vector operation") |
| 63 | } |
| 64 | |
| 65 | v.m.Lock() |
| 66 | defer v.m.Unlock() |
| 67 | |
| 68 | v.records = append(v.records, vectorRecord{ |
| 69 | operation: operation, |
| 70 | value: value, |
| 71 | labelValues: labelValues, |
| 72 | }) |
| 73 | } |
| 74 | |
| 75 | // Commit will set the internal value as the cached value to return from "Collect()". |
| 76 | // The internal metric value is completely reset, so the caller should expect |