userver: utils::statistics::RateCounter Class Reference
Loading...
Searching...
No Matches
utils::statistics::RateCounter Class Referencefinal

#include <userver/utils/statistics/rate_counter.hpp>

Detailed Description

Atomic counter of type Rate with relaxed memory ordering by default.

This class is represented as Rate metric when serializing to statistics. Otherwise it is the same class as utils::statistics::RelaxedCounter.

Examples
samples/tcp_full_duplex_service/main.cpp, and samples/testsuite-support/src/metrics.cpp.

Definition at line 22 of file rate_counter.hpp.

Public Types

using ValueType = Rate
 

Public Member Functions

constexpr RateCounter (Rate desired) noexcept
 
constexpr RateCounter (Rate::ValueType desired) noexcept
 
 RateCounter (const RateCounter &other) noexcept
 
RateCounteroperator= (const RateCounter &other) noexcept
 
RateCounteroperator= (Rate desired) noexcept
 
void Store (Rate desired, std::memory_order order=std::memory_order_relaxed) noexcept
 
Rate Load () const noexcept
 
void Add (Rate arg, std::memory_order order=std::memory_order_relaxed) noexcept
 
void AddAsSingleProducer (Rate arg) noexcept
 
void Increment () noexcept
 
Rate operator++ () noexcept
 
Rate operator++ (int) noexcept
 
Rate operator+= (Rate arg) noexcept
 
Rate operator+= (const RateCounter &arg) noexcept
 

Member Typedef Documentation

◆ ValueType

Constructor & Destructor Documentation

◆ RateCounter() [1/3]

utils::statistics::RateCounter::RateCounter ( Rate desired)
inlineexplicitconstexprnoexcept

Definition at line 28 of file rate_counter.hpp.

◆ RateCounter() [2/3]

utils::statistics::RateCounter::RateCounter ( Rate::ValueType desired)
inlineexplicitconstexprnoexcept

Definition at line 30 of file rate_counter.hpp.

◆ RateCounter() [3/3]

utils::statistics::RateCounter::RateCounter ( const RateCounter & other)
inlinenoexcept

Definition at line 32 of file rate_counter.hpp.

Member Function Documentation

◆ Add()

void utils::statistics::RateCounter::Add ( Rate arg,
std::memory_order order = std::memory_order_relaxed )
inlinenoexcept

Definition at line 54 of file rate_counter.hpp.

◆ AddAsSingleProducer()

void utils::statistics::RateCounter::AddAsSingleProducer ( Rate arg)
inlinenoexcept

Definition at line 58 of file rate_counter.hpp.

◆ Increment()

void utils::statistics::RateCounter::Increment ( )
inlinenoexcept

Definition at line 62 of file rate_counter.hpp.

◆ Load()

Rate utils::statistics::RateCounter::Load ( ) const
inlinenoexcept

Definition at line 52 of file rate_counter.hpp.

◆ operator++() [1/2]

Rate utils::statistics::RateCounter::operator++ ( )
inlinenoexcept

Definition at line 64 of file rate_counter.hpp.

◆ operator++() [2/2]

Rate utils::statistics::RateCounter::operator++ ( int )
inlinenoexcept

Definition at line 66 of file rate_counter.hpp.

◆ operator+=() [1/2]

Rate utils::statistics::RateCounter::operator+= ( const RateCounter & arg)
inlinenoexcept

Definition at line 72 of file rate_counter.hpp.

◆ operator+=() [2/2]

Rate utils::statistics::RateCounter::operator+= ( Rate arg)
inlinenoexcept

Definition at line 68 of file rate_counter.hpp.

◆ operator=() [1/2]

RateCounter & utils::statistics::RateCounter::operator= ( const RateCounter & other)
inlinenoexcept

Definition at line 34 of file rate_counter.hpp.

◆ operator=() [2/2]

RateCounter & utils::statistics::RateCounter::operator= ( Rate desired)
inlinenoexcept

Definition at line 43 of file rate_counter.hpp.

◆ Store()

void utils::statistics::RateCounter::Store ( Rate desired,
std::memory_order order = std::memory_order_relaxed )
inlinenoexcept

Definition at line 48 of file rate_counter.hpp.


The documentation for this class was generated from the following file: