prometheus/pkg
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
..
exemplar Add Exemplar Remote Write support (#8296) 2021-05-06 13:53:52 -07:00
gate Fix exported function comments (#6002) 2019-09-10 14:45:09 +01:00
labels Benchmark Labels.Get() and document the result (#9242) 2021-08-24 16:35:19 +05:30
logging Switched to go-kit/log 2021-06-11 12:28:36 -04:00
modtimevfs *: check that assets are up-to-date (#4731) 2018-11-09 11:31:36 +01:00
pool Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
relabel Check relabel action at yaml unmarshal stage (#9224) 2021-08-31 17:52:57 +02:00
rulefmt fixes yamllint errors 2021-06-12 12:47:47 +02:00
runtime Add new Go build tags. 2021-08-27 10:24:14 +02:00
textparse Create less garbage when parsing metrics (#9299) 2021-09-08 13:39:21 +05:30
timestamp '@ <timestamp>' modifier (#8121) 2021-01-20 16:27:39 +05:30
value Fix spelling/typos (#4921) 2018-11-27 17:44:29 +01:00