Class: Autoscaler::StubScaler

Inherits:
Object
  • Object
show all
Defined in:
lib/autoscaler/stub_scaler.rb

Overview

A minimal scaler to use as stub for local testing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type = 'worker') ⇒ StubScaler

Returns a new instance of StubScaler.

Parameters:

  • type (String) (defaults to: 'worker')

    used to distinguish messages from multiple stubs



7
8
9
10
# File 'lib/autoscaler/stub_scaler.rb', line 7

def initialize(type = 'worker')
  @type = type
  @workers = 0
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



12
13
14
# File 'lib/autoscaler/stub_scaler.rb', line 12

def type
  @type
end

#workersNumeric

Read the current worker count

Returns:

  • (Numeric)

    number of workers



16
17
18
# File 'lib/autoscaler/stub_scaler.rb', line 16

def workers
  @workers
end