prometheus/scrape
Bryan Boreham 8b863c42dd
Optimise relabeling by re-using memory (#11147)
* model/relabel: Add benchmark

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* model/relabel: re-use Builder across relabels

Saves memory allocations.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* labels.Builder: allow re-use of result slice

This reduces memory allocations where the caller has a suitable slice available.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* model/relabel: re-use source values slice

To reduce memory allocations.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Unwind one change causing test failures

Restore original behaviour in PopulateLabels, where we must not overwrite the input set.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* relabel: simplify values optimisation

Use a stack-based array for up to 16 source labels, which will be the
vast majority of cases.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* lint

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2022-08-19 15:27:52 +05:30
..
testdata Re-generate test cert to fix test_windows test failures 2022-03-17 19:37:18 +01:00
helpers_test.go Introduce TSDB changes for appending metadata to the WAL (#10972) 2022-07-19 10:58:52 +02:00
manager.go `no-default-scrape-port` feature flag (#9523) 2022-07-20 13:35:47 +02:00
manager_test.go `no-default-scrape-port` feature flag (#9523) 2022-07-20 13:35:47 +02:00
scrape.go Optimise relabeling by re-using memory (#11147) 2022-08-19 15:27:52 +05:30
scrape_test.go `no-default-scrape-port` feature flag (#9523) 2022-07-20 13:35:47 +02:00
target.go Optimise relabeling by re-using memory (#11147) 2022-08-19 15:27:52 +05:30
target_test.go Optimise relabeling by re-using memory (#11147) 2022-08-19 15:27:52 +05:30