prometheus/model/labels
Bryan Boreham 74b73d1e2c
Labels: Add DropMetricName function, used in PromQL (#13446)
This function is called very frequently when executing PromQL functions,
and we can do it much more efficiently inside Labels.

In the common case that `__name__` comes first in the labels, we simply
re-point to start at the next label, which is nearly free.

`DropMetricName` is now so cheap I removed the cache - benchmarks show
everything still goes faster.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-01-25 11:48:49 +01:00
..
labels.go Labels: Add DropMetricName function, used in PromQL (#13446) 2024-01-25 11:48:49 +01:00
labels_common.go labels: extract common code between slice and stringlabels 2023-11-17 18:20:03 +00:00
labels_stringlabels.go Labels: Add DropMetricName function, used in PromQL (#13446) 2024-01-25 11:48:49 +01:00
labels_test.go Labels: Add DropMetricName function, used in PromQL (#13446) 2024-01-25 11:48:49 +01:00
matcher.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
matcher_test.go feat: dont compile regex matcher if we know its a literal (#12434) 2023-06-07 21:54:30 +01:00
regexp.go feat: dont compile regex matcher if we know its a literal (#12434) 2023-06-07 21:54:30 +01:00
regexp_test.go Allow downstream projects to use faster regexp (#10251) 2022-02-08 11:03:20 +01:00
test_utils.go labels: use ScratchBuilder in ReadLabels 2022-12-19 15:22:09 +00:00