Abstract base class for thread pool metrics.
std::uint64_t total_busy_time_ns() const
Get the total busy time in nanoseconds.
std::uint64_t tasks_executed() const
Get the total number of tasks successfully executed.
std::uint64_t tasks_submitted() const
Get the total number of tasks submitted.
std::uint64_t tasks_failed() const
Get the total number of failed tasks.
std::uint64_t total_idle_time_ns() const
Get the total idle time in nanoseconds.
virtual void reset()
Reset all metrics to their initial state.
Lightweight metrics container shared between thread_pool and workers.
ThreadPoolMetrics()=default
Default constructor.
std::atomic< std::uint64_t > tasks_enqueued_
Counter for enqueued tasks.
void record_enqueue(std::size_t count=1)
Record enqueue operation(s).
Snapshot snapshot() const
Get a snapshot of all metrics.
void reset() override
Reset all metrics to their initial state.
std::uint64_t tasks_enqueued() const
Get the total number of tasks enqueued.
~ThreadPoolMetrics() override=default
Virtual destructor.
Thread pool metrics collection, histograms, and observability.
Snapshot structure containing all metric values.
std::uint64_t tasks_enqueued
std::uint64_t total_idle_time_ns
std::uint64_t tasks_failed
std::uint64_t tasks_executed
std::uint64_t tasks_submitted
std::uint64_t total_busy_time_ns