Class: SidekiqAutoscale::Strategies::DynamicLatencyScaling
- Inherits:
-
BaseScaling
- Object
- BaseScaling
- SidekiqAutoscale::Strategies::DynamicLatencyScaling
- Defined in:
- lib/sidekiq_autoscale/strategies/dynamic_latency_scaling.rb
Constant Summary collapse
- LOG_TAG =
"[SIDEKIQ_SCALE][DYNAMIC_LATENCY_SCALING]"
Instance Method Summary collapse
Methods inherited from BaseScaling
Instance Method Details
#scaling_direction(_job) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/sidekiq_autoscale/strategies/dynamic_latency_scaling.rb', line 11 def scaling_direction(_job) return -1 if workload_too_low? return [scale_up_factor.to_i, 1].max if workload_too_high? 0 end |
#workload_change_needed?(_job) ⇒ Boolean
7 8 9 |
# File 'lib/sidekiq_autoscale/strategies/dynamic_latency_scaling.rb', line 7 def workload_change_needed?(_job) workload_too_high? || workload_too_low? end |