C++ Actor Framework 0.18
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
caf::telemetry::counter< ValueType > Class Template Reference

A metric that represents a single value that can only go up. More...

#include <counter.hpp>

Public Types

using value_type = ValueType
 
using family_setting = unit_t
 

Public Member Functions

 counter (value_type initial_value) noexcept
 
 counter (span< const label >) noexcept
 
void inc () noexcept
 Increments the counter by 1.
 
void inc (value_type amount) noexcept
 Increments the counter by amount.
 
template<class T = ValueType>
std::enable_if_t< std::is_same< T, int64_t >::value, T > operator++ () noexcept
 Increments the counter by 1.
 
value_type value () const noexcept
 Returns the current value of the counter.
 

Static Public Attributes

static constexpr metric_type runtime_type
 

Detailed Description

template<class ValueType>
class caf::telemetry::counter< ValueType >

A metric that represents a single value that can only go up.

Member Function Documentation

◆ inc()

template<class ValueType >
void caf::telemetry::counter< ValueType >::inc ( value_type  amount)
noexcept

Increments the counter by amount.

Precondition
amount > 0

◆ operator++()

template<class ValueType >
template<class T = ValueType>
std::enable_if_t< std::is_same< T, int64_t >::value, T > caf::telemetry::counter< ValueType >::operator++ ( )
noexcept

Increments the counter by 1.

Returns
The new value of the counter.

Member Data Documentation

◆ runtime_type

template<class ValueType >
constexpr metric_type caf::telemetry::counter< ValueType >::runtime_type
staticconstexpr
Initial value:
= std::is_same<value_type, double>::value ? metric_type::dbl_counter
: metric_type::int_counter

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