Core threading foundation of the thread system library.
scaling_direction
Scaling direction for autoscaling decisions.
scaling_reason
Reason for scaling decision.
Scaling direction and metrics for autoscaling decisions.
Configuration for scale-down triggers.
double queue_depth_threshold
Jobs per worker threshold (scale down when below)
double utilization_threshold
Worker utilization threshold (0.0 - 1.0, scale down when below)
std::chrono::seconds idle_duration
Duration worker must be idle before removal.
Configuration for scale-up triggers.
double latency_threshold_ms
P95 latency threshold in milliseconds (scale up when exceeded)
double utilization_threshold
Worker utilization threshold (0.0 - 1.0, scale up when exceeded)
double queue_depth_threshold
Jobs per worker threshold (scale up when exceeded)
std::size_t pending_jobs_threshold
Absolute pending jobs threshold (scale up when exceeded)
Configuration for autoscaling behavior.
auto is_valid() const -> bool
Validates the policy configuration.
std::chrono::seconds scale_down_cooldown
Minimum time between scale-down events.
scale_down_config scale_down
Scale-down trigger configuration.
scale_up_config scale_up
Scale-up trigger configuration.
mode scaling_mode
Autoscaling mode.
@ disabled
No automatic scaling.
@ automatic
Fully automatic scaling.
@ manual
Only scale on explicit trigger.
std::size_t scale_down_increment
Number of workers to remove per scale-down event.
std::chrono::seconds scale_up_cooldown
Minimum time between scale-up events.
double scale_up_factor
Multiplicative factor for scaling (used if use_multiplicative_scaling is true)
std::chrono::milliseconds sample_interval
Interval between metric samples.
std::function< void(scaling_direction, scaling_reason, std::size_t, std::size_t)> scaling_callback
Callback invoked on scaling events Parameters: direction, reason, from_count, to_count.
std::size_t samples_for_decision
Number of samples to aggregate before making a decision.
std::size_t scale_up_increment
Number of workers to add per scale-up event.
std::size_t min_workers
Minimum number of workers (never scale below this)
bool use_multiplicative_scaling
Whether to use multiplicative scaling instead of additive.
std::size_t max_workers
Maximum number of workers (never scale above this)