prometheus-cpp
prometheus-cpp copied to clipboard
Use a less constraining memory order for all "update" operations on Counter/Gauge.
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.