|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Analysis report of bottlenecks in the thread pool. More...
#include <bottleneck_report.h>

Public Member Functions | |
| auto | severity () const -> int |
| Gets the severity level of the bottleneck. | |
| auto | severity_string () const -> std::string |
| Gets severity as a string. | |
| auto | requires_immediate_action () const -> bool |
| Checks if immediate action is required. | |
| auto | to_json () const -> std::string |
| Converts the bottleneck report to a JSON string. | |
| auto | to_string () const -> std::string |
| Converts the bottleneck report to a human-readable string. | |
Public Attributes | |
| bool | has_bottleneck {false} |
| Whether a bottleneck was detected. | |
| std::string | description |
| Human-readable description of the bottleneck. | |
| bottleneck_type | type {bottleneck_type::none} |
| Type of bottleneck detected. | |
| double | queue_saturation {0.0} |
| Queue saturation level. | |
| double | avg_wait_time_ms {0.0} |
| Average wait time in milliseconds. | |
| double | worker_utilization {0.0} |
| Average worker utilization. | |
| std::size_t | estimated_backlog_time_ms {0} |
| Estimated time to process the current backlog. | |
| double | utilization_variance {0.0} |
| Variance in worker utilization. | |
| std::uint64_t | jobs_rejected {0} |
| Jobs rejected due to queue full. | |
| std::size_t | queue_depth {0} |
| Current queue depth. | |
| std::size_t | idle_workers {0} |
| Number of idle workers. | |
| std::size_t | total_workers {0} |
| Total number of workers. | |
| std::vector< std::string > | recommendations |
| Actionable recommendations to resolve the bottleneck. | |
Analysis report of bottlenecks in the thread pool.
Contains the results of bottleneck analysis including the type of bottleneck detected, supporting metrics, and actionable recommendations.
Definition at line 91 of file bottleneck_report.h.
|
inlinenodiscard |
Checks if immediate action is required.
Definition at line 234 of file bottleneck_report.h.
References severity().

|
inlinenodiscard |
Gets the severity level of the bottleneck.
Definition at line 191 of file bottleneck_report.h.
References has_bottleneck, queue_saturation, and worker_utilization.
Referenced by requires_immediate_action(), and severity_string().

|
inlinenodiscard |
Gets severity as a string.
Definition at line 218 of file bottleneck_report.h.
References severity().
Referenced by to_json(), and to_string().


|
inlinenodiscard |
Converts the bottleneck report to a JSON string.
Output format:
Definition at line 265 of file bottleneck_report.h.
References avg_wait_time_ms, kcenon::thread::diagnostics::bottleneck_type_to_string(), description, estimated_backlog_time_ms, has_bottleneck, idle_workers, jobs_rejected, queue_depth, queue_saturation, recommendations, severity_string(), total_workers, type, utilization_variance, and worker_utilization.

|
inlinenodiscard |
Converts the bottleneck report to a human-readable string.
Output format:
Definition at line 333 of file bottleneck_report.h.
References avg_wait_time_ms, kcenon::thread::diagnostics::bottleneck_type_to_string(), description, estimated_backlog_time_ms, has_bottleneck, idle_workers, jobs_rejected, queue_depth, queue_saturation, recommendations, severity_string(), total_workers, type, utilization_variance, and worker_utilization.

| double kcenon::thread::diagnostics::bottleneck_report::avg_wait_time_ms {0.0} |
Average wait time in milliseconds.
Average time jobs spend waiting in the queue before execution.
Definition at line 127 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), to_json(), and to_string().
| std::string kcenon::thread::diagnostics::bottleneck_report::description |
Human-readable description of the bottleneck.
Empty if no bottleneck detected.
Definition at line 103 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), to_json(), and to_string().
| std::size_t kcenon::thread::diagnostics::bottleneck_report::estimated_backlog_time_ms {0} |
Estimated time to process the current backlog.
Based on current processing rate and queue depth.
Definition at line 141 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), to_json(), and to_string().
| bool kcenon::thread::diagnostics::bottleneck_report::has_bottleneck {false} |
Whether a bottleneck was detected.
Definition at line 96 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), severity(), to_json(), and to_string().
| std::size_t kcenon::thread::diagnostics::bottleneck_report::idle_workers {0} |
Number of idle workers.
Definition at line 165 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), to_json(), and to_string().
| std::uint64_t kcenon::thread::diagnostics::bottleneck_report::jobs_rejected {0} |
Jobs rejected due to queue full.
Count of jobs rejected since last reset.
Definition at line 155 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), to_json(), and to_string().
| std::size_t kcenon::thread::diagnostics::bottleneck_report::queue_depth {0} |
Current queue depth.
Definition at line 160 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), to_json(), and to_string().
| double kcenon::thread::diagnostics::bottleneck_report::queue_saturation {0.0} |
Queue saturation level.
Current queue depth as a ratio of maximum capacity (0.0 to 1.0+). Values above 1.0 indicate queue overflow attempts.
Definition at line 120 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), severity(), to_json(), and to_string().
| std::vector<std::string> kcenon::thread::diagnostics::bottleneck_report::recommendations |
Actionable recommendations to resolve the bottleneck.
List of suggestions based on the detected bottleneck type.
Definition at line 181 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::generate_recommendations(), to_json(), and to_string().
| std::size_t kcenon::thread::diagnostics::bottleneck_report::total_workers {0} |
Total number of workers.
Definition at line 170 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), to_json(), and to_string().
| bottleneck_type kcenon::thread::diagnostics::bottleneck_report::type {bottleneck_type::none} |
Type of bottleneck detected.
Definition at line 108 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), kcenon::thread::diagnostics::thread_pool_diagnostics::generate_recommendations(), to_json(), and to_string().
| double kcenon::thread::diagnostics::bottleneck_report::utilization_variance {0.0} |
Variance in worker utilization.
High variance indicates uneven work distribution.
Definition at line 148 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), to_json(), and to_string().
| double kcenon::thread::diagnostics::bottleneck_report::worker_utilization {0.0} |
Average worker utilization.
Average ratio of busy time across all workers (0.0 to 1.0).
Definition at line 134 of file bottleneck_report.h.
Referenced by kcenon::thread::diagnostics::thread_pool_diagnostics::detect_bottlenecks(), severity(), to_json(), and to_string().