perfc 0.11.0
Loading...
Searching...
No Matches
counter.hpp File Reference

Performance counter implementation. More...

#include <atomic>
#include <chrono>
#include <type_traits>

Go to the source code of this file.

Classes

struct  perfc::Timestamped< T, TimePoint >
 Trivial type describing a counter value and associated timestamp. More...
 
class  perfc::Counter< T, void, typename std::enable_if< std::is_integral< T >::value >::type >
 Integrals w/o timestamp Partial specialization for integral types T and without clock. More...
 
class  perfc::Counter< T, void, typename std::enable_if<!std::is_integral< T >::value >::type >
 Non-integrals w/o timestamp Partial specialization matching void clocks and non-integral T's. More...
 
class  perfc::Counter< T, Clock, typename std::enable_if<!std::is_void< Clock >::value >::type >
 With timestamp Partial specialization for non-void Clock type. More...
 

Namespaces

namespace  perfc
 

Typedefs

Aliases of timestamped counters

These aliases are using the clock std::steady_clock as a timestamp source.

using perfc::CounterDoubleTs = Counter<double, std::chrono::steady_clock>
 
using perfc::CounterU64Ts = Counter<std::uint64_t, std::chrono::steady_clock>
 
using perfc::CounterI64Ts = Counter<std::int64_t, std::chrono::steady_clock>
 
Aliases of non-timestamped counters

These counters aliases have no internal timestamp and are very light weight and on most 64bit architectures they are fully lock-free.

using perfc::CounterDouble = Counter<double, void>
 
using perfc::CounterU64 = Counter<std::uint64_t, void>
 
using perfc::CounterI64 = Counter<std::int64_t, void>
 

Functions

Synchronization functions

Provides capability to synchronize relaxed atomic counter reads and writes.

void perfc::CounterAcquire () noexcept
 Synchronizes-with CounterRelease() or Counter store operations using MemoryOrder::Release.
 
void perfc::CounterRelease () noexcept
 Synchronizes-with CounterAcquire() or counter load operations using MemoryOrder::Acquire.
 

Detailed Description

Performance counter implementation.

Definition in file counter.hpp.