149 [[nodiscard]]
double get() const noexcept;
165 alignas(64)
std::atomic<uint64_t> total_active_{0};
167 ElapsedTimer cpu_timestamp_timer_{ElapsedTimer::kCpuTimestamp, ElapsedTimer::kNano};
static bool is_global_enabled() noexcept
Returns whether CPU profiling is globally enabled via environment variable.
void begin() noexcept
Marks the start of an active CPU work section.
double get() const noexcept
Returns the current CPU utilisation ratio as a percentage.
CpuProfiler() noexcept
Constructs a profiler with all accumulators initialised to zero.
double restart() noexcept
Returns the current utilisation and resets all accumulators to zero.
void end() noexcept
Marks the end of an active CPU work section and accumulates the elapsed time.
Atomic, high-resolution elapsed-time timer.
Definition elapsed_timer.h:93
@ kNano
Nanosecond precision.
Definition elapsed_timer.h:109
@ kCpuActiveTime
Process CPU time (user + kernel, via getrusage).
Definition elapsed_timer.h:100
High-resolution elapsed-time measurement with configurable clock source and precision.
Platform-independent macro definitions for the VLink library.
#define VLINK_EXPORT
Definition macros.h:85
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
Definition macros.h:184
Adaptive, cache-line-aligned spin lock and RAII guard.