ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
pool_statistics.hpp
Go to the documentation of this file.
1#pragma once
2
8#include <chrono>
9#include <cstddef>
10
11namespace threadschedule
12{
13
21{
23 std::size_t total_threads{ 0 };
25 std::size_t active_threads{ 0 };
27 std::size_t pending_tasks{ 0 };
29 std::size_t completed_tasks{ 0 };
31 std::size_t stolen_tasks{ 0 };
33 double tasks_per_second{ 0.0 };
35 std::chrono::microseconds average_task_time{ 0 };
36};
37
38} // namespace threadschedule
Snapshot of pool activity metrics.
std::size_t stolen_tasks
Total number of tasks stolen by workers (work-stealing pools).
std::size_t total_threads
Number of worker threads owned by the pool.
std::size_t completed_tasks
Total number of tasks completed since pool start.
std::size_t pending_tasks
Number of queued tasks waiting for execution.
std::size_t active_threads
Number of workers currently executing a task.
std::chrono::microseconds average_task_time
Average task execution time measured by the backend.
double tasks_per_second
Approximate throughput in tasks per second.