Class: Amigo::Autoscaler::Handlers::Log
- Inherits:
-
Amigo::Autoscaler::Handler
- Object
- Amigo::Autoscaler::Handler
- Amigo::Autoscaler::Handlers::Log
- Defined in:
- lib/amigo/autoscaler/handlers/log.rb
Constant Summary collapse
Instance Method Summary collapse
-
#initialize(message: "high_latency_queues", log: DEFAULT_LOG) ⇒ Log
constructor
A new instance of Log.
- #scale_down(depth:, duration:) ⇒ Object
- #scale_up(high_latencies:, depth:, duration:, pool_usage:) ⇒ Object
Constructor Details
#initialize(message: "high_latency_queues", log: DEFAULT_LOG) ⇒ Log
Returns a new instance of Log.
15 16 17 18 19 |
# File 'lib/amigo/autoscaler/handlers/log.rb', line 15 def initialize(message: "high_latency_queues", log: DEFAULT_LOG) @message = @log = log super() end |
Instance Method Details
#scale_down(depth:, duration:) ⇒ Object
25 26 27 |
# File 'lib/amigo/autoscaler/handlers/log.rb', line 25 def scale_down(depth:, duration:, **) self._log(:info, "#{@message}_restored", depth:, duration:) end |
#scale_up(high_latencies:, depth:, duration:, pool_usage:) ⇒ Object
21 22 23 |
# File 'lib/amigo/autoscaler/handlers/log.rb', line 21 def scale_up(high_latencies:, depth:, duration:, pool_usage:, **) self._log(:warn, @message, queues: high_latencies, depth:, duration:, pool_usage:) end |