-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: reduce allocs when serving metrics
This PR uses HTTP chunking to stream the metrics instead of joining all the metrics and writing that single blob. ## Scenario - Poll sar with single Rest volume collector - curl metrics endpoint 240 times - take heap dump and report on `alloc_space` bytes for `Prometheus.ServeMetrics` Before change: 457.75 MB is alloced from `ServeMetrics` After change: 1 MB is alloced from `ServeMetrics` Thanks to ChrisGautcher for reporting
- Loading branch information
Showing
2 changed files
with
73 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters