prometheus/scrape
Bryan Boreham 92a3eeac55
Create less garbage when parsing metrics (#9299)
* Refactor: extract function to make scrapeLoop for testing

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

* Add benchmarks for ScrapeLoopAppend

For Prometheus and OpenMetrics

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

* Create less garbage when parsing metrics

Exemplar escapes to heap due to being passed through text-parser
interface, but we can reduce the impact by hoisting it out of the loop
and resetting it after every use.

(Note the cost was paid on every line even when exemplars were disabled)

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

* Create less garbage when parsing OpenMetrics

After calling parseLVals() we always append the return value, so pass in
what we want to append it to and save garbage.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2021-09-08 13:39:21 +05:30
..
testdata Use SAN in test certificate (#7789) 2020-08-12 23:15:38 +02:00
helpers_test.go Add circular in-memory exemplars storage (#6635) 2021-03-16 15:17:45 +05:30
manager.go Add scrape_timeout_seconds metric 2021-09-02 12:15:35 +02:00
manager_test.go Add scrape_timeout_seconds metric 2021-09-02 12:15:35 +02:00
scrape.go Create less garbage when parsing metrics (#9299) 2021-09-08 13:39:21 +05:30
scrape_test.go Create less garbage when parsing metrics (#9299) 2021-09-08 13:39:21 +05:30
target.go Configure Scrape Interval and Timeout Via Relabeling (#8911) 2021-08-31 17:37:32 +02:00
target_test.go Configure Scrape Interval and Timeout Via Relabeling (#8911) 2021-08-31 17:37:32 +02:00