labels: note that Hash may change

For performance reasons we may use a different implementation of Hash()
in future, so note this so callers can be warned.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2022-11-28 16:16:55 +00:00
parent dfa5cd55db
commit 8d4140a06e

View file

@ -134,6 +134,7 @@ func (ls Labels) MatchLabels(on bool, names ...string) Labels {
}
// Hash returns a hash value for the label set.
// Note: the result is not guaranteed to be consistent across different runs of Prometheus.
func (ls Labels) Hash() uint64 {
// Use xxhash.Sum64(b) for fast path as it's faster.
b := make([]byte, 0, 1024)