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

Metrics sample for autoscaling decisions. More...

#include <scaling_metrics.h>

Collaboration diagram for kcenon::thread::scaling_metrics_sample:
Collaboration graph

Public Attributes

std::chrono::steady_clock::time_point timestamp
 Timestamp when this sample was collected.
 
std::size_t worker_count {0}
 Current number of workers in the pool.
 
std::size_t active_workers {0}
 Number of workers currently processing jobs.
 
std::size_t queue_depth {0}
 Number of jobs waiting in the queue.
 
double utilization {0.0}
 Worker utilization ratio (0.0 - 1.0)
 
double queue_depth_per_worker {0.0}
 Jobs per worker ratio.
 
double p95_latency_ms {0.0}
 P95 latency in milliseconds.
 
std::uint64_t jobs_completed {0}
 Jobs completed since last sample.
 
std::uint64_t jobs_submitted {0}
 Jobs submitted since last sample.
 
double throughput_per_second {0.0}
 Throughput in jobs per second.
 

Detailed Description

Metrics sample for autoscaling decisions.

This structure captures a snapshot of thread pool metrics at a specific point in time. Multiple samples are aggregated to make scaling decisions, preventing reactive scaling on transient spikes.

See also
autoscaler

Definition at line 51 of file scaling_metrics.h.

Member Data Documentation

◆ active_workers

std::size_t kcenon::thread::scaling_metrics_sample::active_workers {0}

Number of workers currently processing jobs.

Definition at line 60 of file scaling_metrics.h.

60{0};

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ jobs_completed

std::uint64_t kcenon::thread::scaling_metrics_sample::jobs_completed {0}

Jobs completed since last sample.

Definition at line 75 of file scaling_metrics.h.

75{0};

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ jobs_submitted

std::uint64_t kcenon::thread::scaling_metrics_sample::jobs_submitted {0}

Jobs submitted since last sample.

Definition at line 78 of file scaling_metrics.h.

78{0};

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ p95_latency_ms

double kcenon::thread::scaling_metrics_sample::p95_latency_ms {0.0}

P95 latency in milliseconds.

Definition at line 72 of file scaling_metrics.h.

72{0.0};

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ queue_depth

std::size_t kcenon::thread::scaling_metrics_sample::queue_depth {0}

Number of jobs waiting in the queue.

Definition at line 63 of file scaling_metrics.h.

63{0};

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ queue_depth_per_worker

double kcenon::thread::scaling_metrics_sample::queue_depth_per_worker {0.0}

Jobs per worker ratio.

Definition at line 69 of file scaling_metrics.h.

69{0.0};

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ throughput_per_second

double kcenon::thread::scaling_metrics_sample::throughput_per_second {0.0}

Throughput in jobs per second.

Definition at line 81 of file scaling_metrics.h.

81{0.0};

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ timestamp

std::chrono::steady_clock::time_point kcenon::thread::scaling_metrics_sample::timestamp

Timestamp when this sample was collected.

Definition at line 54 of file scaling_metrics.h.

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ utilization

double kcenon::thread::scaling_metrics_sample::utilization {0.0}

Worker utilization ratio (0.0 - 1.0)

Definition at line 66 of file scaling_metrics.h.

66{0.0};

Referenced by kcenon::thread::autoscaler::collect_metrics().

◆ worker_count

std::size_t kcenon::thread::scaling_metrics_sample::worker_count {0}

Current number of workers in the pool.

Definition at line 57 of file scaling_metrics.h.

57{0};

Referenced by kcenon::thread::autoscaler::collect_metrics().


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