File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,8 @@ var replacer = strings.NewReplacer(
9595 "%" , "_percent" ,
9696)
9797
98- // labelPair joins two slices of keys and values
99- // and allows simultaneous sorting.
98+ // labelPair joins two slices of keys and values and allows
99+ // simultaneous sorting. It implements sort.Interface .
100100type labelPair struct {
101101 keys []string
102102 vals []string
@@ -175,8 +175,10 @@ var separatorByteSlice = []byte{prom_model.SeparatorByte}
175175
176176// LabelsSignature returns a hash of the labels. It emulates
177177// prometheus' LabelsToSignature implementation but works on
178- // labelPair instead of map[string]string. Assumes that
179- // the labels are sorted.
178+ // labelPair instead of map[string]string.
179+ // Assumes that the labels are sorted. Notably, this uses
180+ // a different hash function than prometheus, but it doesn't
181+ // matter for the purpose of computing a unique signature.
180182func (p * PrometheusMetric ) LabelsSignature () uint64 {
181183 xxh := xxhash .New ()
182184 for i , key := range p .labels .keys {
You can’t perform that action at this time.
0 commit comments