prometheus-cpp icon indicating copy to clipboard operation
prometheus-cpp copied to clipboard

Use a less constraining memory order for all "update" operations on Counter/Gauge.

Open Romain-Geissler-1A opened this issue 1 year ago • 3 comments

Updates on metrics is something that happens much more often than
collecting operations, and it doesn't require strong atomic guarantees
(ie if two threads update a metric at the same time, we might accept
that it's not always the very last update that is being kept in the
metric). We sacrifice a bit correctness in case of multithread
concurrent updates (which is a rather rare scenario) for better
performances all the time (ie even with a single thread, or not
concurrent updates).

Note: this contains the commit of #622 which you shall review/merge separately from this pull request.

Romain-Geissler-1A avatar Dec 08 '22 16:12 Romain-Geissler-1A