#include <userver/utils/statistics/striped_rate_counter.hpp>
Atomic counter of type Rate with relaxed memory ordering, increased memory consumption and decreased contention.
This class is represented as Rate metric when serializing to statistics.
Differences from utils::statistics::RateCounter:
8 * N_CORES
memory, while RateCounter is just a single atomic.Use StripedRateCounter instead of RateCounter sparingly, in places where a lot of threads are supposed to be hammering on the same metrics.
Definition at line 31 of file striped_rate_counter.hpp.
Public Types | |
using | ValueType = Rate |
Public Member Functions | |
StripedRateCounter (Rate desired) | |
StripedRateCounter (Rate::ValueType desired) | |
StripedRateCounter (const StripedRateCounter &other) | |
StripedRateCounter & | operator= (const StripedRateCounter &other) noexcept |
StripedRateCounter & | operator= (Rate desired) noexcept |
void | Store (Rate desired) noexcept |
Rate | Load () const noexcept |
void | Add (Rate arg) noexcept |
StripedRateCounter & | operator++ () noexcept |
StripedRateCounter & | operator+= (Rate arg) noexcept |
StripedRateCounter & | operator+= (const StripedRateCounter &arg) noexcept |
Definition at line 33 of file striped_rate_counter.hpp.
|
inlineexplicit |
Definition at line 37 of file striped_rate_counter.hpp.
|
inlineexplicit |
Definition at line 39 of file striped_rate_counter.hpp.
|
inline |
Definition at line 42 of file striped_rate_counter.hpp.
Definition at line 66 of file striped_rate_counter.hpp.
|
inlinenoexcept |
Definition at line 62 of file striped_rate_counter.hpp.
|
inlinenoexcept |
Definition at line 70 of file striped_rate_counter.hpp.
|
inlinenoexcept |
Definition at line 80 of file striped_rate_counter.hpp.
|
inlinenoexcept |
Definition at line 75 of file striped_rate_counter.hpp.
|
inlinenoexcept |
Definition at line 46 of file striped_rate_counter.hpp.
|
inlinenoexcept |
Definition at line 53 of file striped_rate_counter.hpp.
Definition at line 58 of file striped_rate_counter.hpp.