Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
kcenon::thread::dag_stats Struct Reference

Statistics about DAG execution. More...

#include <dag_config.h>

Collaboration diagram for kcenon::thread::dag_stats:
Collaboration graph

Public Member Functions

auto is_complete () const -> bool
 Check if all jobs are complete (success or failure)
 
auto all_succeeded () const -> bool
 Check if all jobs succeeded.
 
auto success_rate () const -> double
 Calculate success rate.
 

Public Attributes

std::size_t total_jobs {0}
 Total number of jobs in DAG.
 
std::size_t completed_jobs {0}
 Number of successfully completed jobs.
 
std::size_t failed_jobs {0}
 Number of failed jobs.
 
std::size_t pending_jobs {0}
 Number of pending jobs.
 
std::size_t running_jobs {0}
 Number of currently running jobs.
 
std::size_t skipped_jobs {0}
 Number of skipped jobs.
 
std::size_t cancelled_jobs {0}
 Number of cancelled jobs.
 
std::chrono::milliseconds total_execution_time {0}
 Total wall-clock time.
 
std::chrono::milliseconds critical_path_time {0}
 Time of longest path.
 
double parallelism_efficiency {0.0}
 Actual vs theoretical speedup.
 

Detailed Description

Statistics about DAG execution.

Definition at line 147 of file dag_config.h.

Member Function Documentation

◆ all_succeeded()

auto kcenon::thread::dag_stats::all_succeeded ( ) const -> bool
inlinenodiscard

Check if all jobs succeeded.

Returns
true if all jobs completed successfully

Definition at line 174 of file dag_config.h.

175 {
176 return is_complete() && failed_jobs == 0 && cancelled_jobs == 0;
177 }
std::size_t cancelled_jobs
Number of cancelled jobs.
Definition dag_config.h:155
std::size_t failed_jobs
Number of failed jobs.
Definition dag_config.h:151
auto is_complete() const -> bool
Check if all jobs are complete (success or failure)
Definition dag_config.h:165

References cancelled_jobs, failed_jobs, and is_complete().

Here is the call graph for this function:

◆ is_complete()

auto kcenon::thread::dag_stats::is_complete ( ) const -> bool
inlinenodiscard

Check if all jobs are complete (success or failure)

Returns
true if no more jobs to execute

Definition at line 165 of file dag_config.h.

166 {
167 return pending_jobs == 0 && running_jobs == 0;
168 }
std::size_t pending_jobs
Number of pending jobs.
Definition dag_config.h:152
std::size_t running_jobs
Number of currently running jobs.
Definition dag_config.h:153

References pending_jobs, and running_jobs.

Referenced by all_succeeded().

Here is the caller graph for this function:

◆ success_rate()

auto kcenon::thread::dag_stats::success_rate ( ) const -> double
inlinenodiscard

Calculate success rate.

Returns
Success rate as a percentage (0.0 to 1.0)

Definition at line 183 of file dag_config.h.

184 {
185 if (total_jobs == 0) return 0.0;
186 return static_cast<double>(completed_jobs) / static_cast<double>(total_jobs);
187 }
std::size_t total_jobs
Total number of jobs in DAG.
Definition dag_config.h:149
std::size_t completed_jobs
Number of successfully completed jobs.
Definition dag_config.h:150

References completed_jobs, and total_jobs.

Member Data Documentation

◆ cancelled_jobs

std::size_t kcenon::thread::dag_stats::cancelled_jobs {0}

Number of cancelled jobs.

Definition at line 155 of file dag_config.h.

155{0};

Referenced by all_succeeded(), and kcenon::thread::dag_scheduler::get_stats().

◆ completed_jobs

std::size_t kcenon::thread::dag_stats::completed_jobs {0}

Number of successfully completed jobs.

Definition at line 150 of file dag_config.h.

150{0};

Referenced by kcenon::thread::dag_scheduler::get_stats(), and success_rate().

◆ critical_path_time

std::chrono::milliseconds kcenon::thread::dag_stats::critical_path_time {0}

Time of longest path.

Definition at line 158 of file dag_config.h.

158{0};

◆ failed_jobs

std::size_t kcenon::thread::dag_stats::failed_jobs {0}

Number of failed jobs.

Definition at line 151 of file dag_config.h.

151{0};

Referenced by all_succeeded(), and kcenon::thread::dag_scheduler::get_stats().

◆ parallelism_efficiency

double kcenon::thread::dag_stats::parallelism_efficiency {0.0}

Actual vs theoretical speedup.

Definition at line 159 of file dag_config.h.

159{0.0};

◆ pending_jobs

std::size_t kcenon::thread::dag_stats::pending_jobs {0}

Number of pending jobs.

Definition at line 152 of file dag_config.h.

152{0};

Referenced by kcenon::thread::dag_scheduler::get_stats(), and is_complete().

◆ running_jobs

std::size_t kcenon::thread::dag_stats::running_jobs {0}

Number of currently running jobs.

Definition at line 153 of file dag_config.h.

153{0};

Referenced by kcenon::thread::dag_scheduler::get_stats(), and is_complete().

◆ skipped_jobs

std::size_t kcenon::thread::dag_stats::skipped_jobs {0}

Number of skipped jobs.

Definition at line 154 of file dag_config.h.

154{0};

Referenced by kcenon::thread::dag_scheduler::get_stats().

◆ total_execution_time

std::chrono::milliseconds kcenon::thread::dag_stats::total_execution_time {0}

Total wall-clock time.

Definition at line 157 of file dag_config.h.

157{0};

Referenced by kcenon::thread::dag_scheduler::get_stats().

◆ total_jobs

std::size_t kcenon::thread::dag_stats::total_jobs {0}

Total number of jobs in DAG.

Definition at line 149 of file dag_config.h.

149{0};

Referenced by kcenon::thread::dag_scheduler::get_stats(), and success_rate().


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