chronon::observe::EventCounter
Counter plus optional first-class timeline instant emission. More...
#include <EventCounter.hpp>
Public Functions
| Name | |
|---|---|
| const std::string & | unit() const |
| void | reset() |
| EventCounter & | operator=(const EventCounter & ) =delete |
| EventCounter & | operator=(EventCounter && ) =default |
| EventCounter & | operator+=(uint64_t delta) |
| EventCounter & | operator++() |
| operator const Counter &() const | |
| operator Counter &() | |
| const std::string & | name() const |
| template <FixedString Name,typename Cat ,typename... Items> void | mark(Cat category, Items &&... items) |
| template <FixedString Name,typename Cat ,typename... Items> void | mark(uint64_t delta, Cat category, Items &&... items) |
| bool | isRegistered() const |
| CounterId | id() const |
| uint64_t | get() const |
| const std::string & | description() const |
| Counter & | counter() |
| const Counter & | counter() const |
| void | add(uint64_t delta =1) |
| template <FixedString Name,typename Cat ,typename... Items> void | add(uint64_t delta, Cat category, Items &&... items) |
| EventCounter(ObservableUnit * owner, std::string_view name, std::string_view description ="", std::string_view unit ="") | |
| EventCounter(const EventCounter & ) =delete | |
| EventCounter(EventCounter && ) =default |
Detailed Description
class chronon::observe::EventCounter;
Counter plus optional first-class timeline instant emission.
Use this for aggregate metrics that may also need timestamped samples. add()/operator++/operator+= update the aggregate counter only; mark() updates the counter and emits a first-class timeline instant.
EventCounter uart_tx_{this, "chars_tx", "Characters transmitted", "chars"};
uart_tx_.mark<"uart_tx">(UART, arg<"byte">(byte));
flushed_instrs_.add(removed);
flushed_instrs_.mark<"decode_flush">(removed, FLUSH, arg<"remaining">(n));
Public Functions Documentation
function unit
inline const std::string & unit() const
function reset
inline void reset()
function operator=
EventCounter & operator=(
const EventCounter &
) =delete
function operator=
EventCounter & operator=(
EventCounter &&
) =default
function operator+=
inline EventCounter & operator+=(
uint64_t delta
)
function operator++
inline EventCounter & operator++()
function operator const Counter &
inline operator const Counter &() const
function operator Counter &
inline operator Counter &()
function name
inline const std::string & name() const
function mark
template <FixedString Name,
typename Cat ,
typename... Items>
inline void mark(
Cat category,
Items &&... items
)
function mark
template <FixedString Name,
typename Cat ,
typename... Items>
inline void mark(
uint64_t delta,
Cat category,
Items &&... items
)
function isRegistered
inline bool isRegistered() const
function id
inline CounterId id() const
function get
inline uint64_t get() const
function description
inline const std::string & description() const
function counter
inline Counter & counter()
function counter
inline const Counter & counter() const
function add
inline void add(
uint64_t delta =1
)
function add
template <FixedString Name,
typename Cat ,
typename... Items>
inline void add(
uint64_t delta,
Cat category,
Items &&... items
)
function EventCounter
inline EventCounter(
ObservableUnit * owner,
std::string_view name,
std::string_view description ="",
std::string_view unit =""
)
function EventCounter
EventCounter(
const EventCounter &
) =delete
function EventCounter
EventCounter(
EventCounter &&
) =default
Updated on 2026-07-06 at 09:03:34 +0000