HIPO  4.3.0
High Performance Output data format for experimental physics
ThreadPool::Statistics Struct Reference

Runtime statistics for thread pool performance monitoring. More...

#include <threadpool.hpp>

Public Member Functions

 Statistics ()=default
 Default constructor. More...
 
 Statistics (const Statistics &)=delete
 Non-copyable (atomic members cannot be copied). More...
 
Statisticsoperator= (const Statistics &)=delete
 Non-copyable (atomic members cannot be copied). More...
 
 Statistics (Statistics &&other) noexcept
 Move constructor; transfers statistics state. More...
 
Statisticsoperator= (Statistics &&other) noexcept
 Move assignment; transfers statistics state. More...
 
auto get_throughput () const noexcept -> double
 Calculates tasks completed per second. More...
 
auto get_uptime () const noexcept -> std::chrono::duration< double >
 Calculates time elapsed since pool creation. More...
 

Public Attributes

std::atomic< std::size_t > tasks_submitted {0}
 Total tasks submitted to the pool. More...
 
std::atomic< std::size_t > tasks_completed {0}
 Total tasks completed successfully. More...
 
std::atomic< std::size_t > tasks_failed {0}
 Total tasks that failed or threw exceptions. More...
 
std::atomic< std::size_t > tasks_pending {0}
 Current number of pending (not yet executed) tasks. More...
 
std::chrono::steady_clock::time_point start_time {std::chrono::steady_clock::now()}
 Pool creation timestamp. More...
 

Detailed Description

Runtime statistics for thread pool performance monitoring.

Tracks metrics such as submitted tasks, completed tasks, failed tasks, and pending work, as well as the pool's uptime and throughput.

Definition at line 52 of file threadpool.hpp.

Constructor & Destructor Documentation

◆ Statistics() [1/2]

ThreadPool::Statistics::Statistics ( )
default

Default constructor.

◆ Statistics() [2/2]

ThreadPool::Statistics::Statistics ( const Statistics )
delete

Non-copyable (atomic members cannot be copied).

Member Function Documentation

◆ operator=()

Statistics& ThreadPool::Statistics::operator= ( const Statistics )
delete

Non-copyable (atomic members cannot be copied).

Member Data Documentation

◆ start_time

std::chrono::steady_clock::time_point ThreadPool::Statistics::start_time {std::chrono::steady_clock::now()}

Pool creation timestamp.

Definition at line 57 of file threadpool.hpp.

◆ tasks_completed

std::atomic<std::size_t> ThreadPool::Statistics::tasks_completed {0}

Total tasks completed successfully.

Definition at line 54 of file threadpool.hpp.

◆ tasks_failed

std::atomic<std::size_t> ThreadPool::Statistics::tasks_failed {0}

Total tasks that failed or threw exceptions.

Definition at line 55 of file threadpool.hpp.

◆ tasks_pending

std::atomic<std::size_t> ThreadPool::Statistics::tasks_pending {0}

Current number of pending (not yet executed) tasks.

Definition at line 56 of file threadpool.hpp.

◆ tasks_submitted

std::atomic<std::size_t> ThreadPool::Statistics::tasks_submitted {0}

Total tasks submitted to the pool.

Definition at line 53 of file threadpool.hpp.


The documentation for this struct was generated from the following file: