176 return static_cast<double>(successes) /
static_cast<double>(attempts);
187 auto batches =
batch_steals.load(std::memory_order_relaxed);
193 return static_cast<double>(total) /
static_cast<double>(batches);
207 auto total = same + cross;
212 return static_cast<double>(cross) /
static_cast<double>(total);
229 return static_cast<double>(total_time) /
static_cast<double>(attempts);
Core threading foundation of the thread system library.
Non-atomic snapshot of work-stealing statistics.
std::uint64_t successful_steals
std::uint64_t total_batch_size
auto cross_node_ratio() const -> double
auto steal_success_rate() const -> double
std::uint64_t failed_steals
std::uint64_t same_node_steals
auto avg_steal_time_ns() const -> double
std::uint64_t total_steal_time_ns
auto avg_batch_size() const -> double
std::uint64_t steal_attempts
std::uint64_t cross_node_steals
std::uint64_t total_backoff_time_ns
std::uint64_t batch_steals
std::uint64_t jobs_stolen
Statistics for work-stealing operations.
std::atomic< std::uint64_t > total_steal_time_ns
Total time spent in steal operations (nanoseconds)
std::atomic< std::uint64_t > total_backoff_time_ns
Total time spent in backoff delays (nanoseconds)
auto avg_batch_size() const -> double
Calculate the average batch size.
std::atomic< std::uint64_t > failed_steals
Number of failed steal operations.
auto snapshot() const -> work_stealing_stats_snapshot
Create a snapshot of current statistics.
std::atomic< std::uint64_t > jobs_stolen
Total number of jobs successfully stolen.
std::atomic< std::uint64_t > total_batch_size
Total size of all batch steals (for averaging)
auto avg_steal_time_ns() const -> double
Calculate average steal operation time.
std::atomic< std::uint64_t > cross_node_steals
Steals from workers on different NUMA nodes.
std::atomic< std::uint64_t > successful_steals
Number of successful steal operations.
std::atomic< std::uint64_t > steal_attempts
Total number of steal attempts.
std::atomic< std::uint64_t > batch_steals
Number of batch steal operations (stealing multiple jobs)
void reset()
Reset all statistics to zero.
std::atomic< std::uint64_t > same_node_steals
Steals from workers on the same NUMA node.
auto cross_node_ratio() const -> double
Calculate the cross-NUMA node steal ratio.
auto steal_success_rate() const -> double
Calculate the steal success rate.