Class: ScaleWorkers::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/scale_workers/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/scale_workers/configuration.rb', line 11

def initialize
  self.max_failure           = 5
  self.max_workers           = 5
  self.min_workers           = 1
  self.sleep_time            = 5.minutes
  self.increment_step        = 1
  self.decrement_step        = -2
  self.notification_interval = 15
  # machine load attrs
  self.max_memory_load       = 70
  self.max_cpu_load          = 50
  self.load_cycles           = 5
  self.load_sleep_time       = 10
  self.adapter               = 'delayed_job_active_record'
  self.worker_executable_path = 'script/delayed_job'
end

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



9
10
11
# File 'lib/scale_workers/configuration.rb', line 9

def adapter
  @adapter
end

#count_procedureObject

Returns the value of attribute count_procedure.



7
8
9
# File 'lib/scale_workers/configuration.rb', line 7

def count_procedure
  @count_procedure
end

#decrement_stepObject

Returns the value of attribute decrement_step.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def decrement_step
  @decrement_step
end

#increment_stepObject

Returns the value of attribute increment_step.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def increment_step
  @increment_step
end

#load_cyclesObject

Returns the value of attribute load_cycles.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def load_cycles
  @load_cycles
end

#load_sleep_timeObject

Returns the value of attribute load_sleep_time.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def load_sleep_time
  @load_sleep_time
end

#max_cpu_loadObject

Returns the value of attribute max_cpu_load.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def max_cpu_load
  @max_cpu_load
end

#max_failureObject

Returns the value of attribute max_failure.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def max_failure
  @max_failure
end

#max_memory_loadObject

Returns the value of attribute max_memory_load.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def max_memory_load
  @max_memory_load
end

#max_workersObject

Returns the value of attribute max_workers.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def max_workers
  @max_workers
end

#min_workersObject

Returns the value of attribute min_workers.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def min_workers
  @min_workers
end

#notification_intervalObject

Returns the value of attribute notification_interval.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def notification_interval
  @notification_interval
end

#sleep_timeObject

Returns the value of attribute sleep_time.



4
5
6
# File 'lib/scale_workers/configuration.rb', line 4

def sleep_time
  @sleep_time
end

#start_procedureObject

Returns the value of attribute start_procedure.



7
8
9
# File 'lib/scale_workers/configuration.rb', line 7

def start_procedure
  @start_procedure
end

#stop_procedureObject

Returns the value of attribute stop_procedure.



7
8
9
# File 'lib/scale_workers/configuration.rb', line 7

def stop_procedure
  @stop_procedure
end

#worker_executable_pathObject

Returns the value of attribute worker_executable_path.



9
10
11
# File 'lib/scale_workers/configuration.rb', line 9

def worker_executable_path
  @worker_executable_path
end