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



5
6
7
8
# File 'lib/autoscaler/stub_scaler.rb', line 5

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

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



10
11
12
# File 'lib/autoscaler/stub_scaler.rb', line 10

def type
  @type
end

#workersNumeric

Read the current worker count

Returns:

  • (Numeric)

    number of workers



14
15
16
# File 'lib/autoscaler/stub_scaler.rb', line 14

def workers
  @workers
end