prometheus/model/labels
Bryan Boreham 1e16c60bae labels: improve Get method for stringlabels build (#12485)
Inline one call to `decodeString`, and skip decoding the value string
until we find a match for the name.
Do a quick check on the first character in each string,
and exit early if we've gone past - labels are sorted in order.

Also improve tests and benchmark:
* labels: test Get with varying lengths - it's not typical for Prometheus labels to all be the same length.
* extend benchmark with label not found

---------

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-07-03 20:34:35 +01:00
..
labels.go Merge pull request #12366 from prometheus/release-2.44 2023-05-16 18:06:29 +01:00
labels_string.go labels: improve Get method for stringlabels build (#12485) 2023-07-03 20:34:35 +01:00
labels_test.go labels: improve Get method for stringlabels build (#12485) 2023-07-03 20:34:35 +01:00
matcher.go track-number-of-optimized-regexp-label-matchers - make isRegexOptimized (#481) 2023-04-18 07:24:41 +00:00
matcher_test.go track-number-of-optimized-regexp-label-matchers - make isRegexOptimized (#481) 2023-04-18 07:24:41 +00:00
regexp.go Fix lint 2023-04-26 22:22:31 +08:00
regexp_test.go track-number-of-optimized-regexp-label-matchers - make isRegexOptimized (#481) 2023-04-18 07:24:41 +00:00
sharding.go labels: add stringlabels version of StableHash 2023-05-02 15:51:17 +01:00
sharding_stringlabels.go mv sharding_string.go sharding_stringlabels.go 2023-05-05 12:53:56 +02:00
sharding_test.go Add TestStableHash 2023-05-04 16:54:39 +02:00
test_utils.go labels: use ScratchBuilder in ReadLabels 2022-12-19 15:22:09 +00:00