class ScaleWorkers::Configuration

Attributes

adapter[RW]
count_procedure[RW]
decrement_step[RW]
increment_step[RW]
load_cycles[RW]
load_sleep_time[RW]
max_cpu_load[RW]
max_failure[RW]
max_memory_load[RW]
max_workers[RW]
min_workers[RW]
notification_interval[RW]
sleep_time[RW]
start_procedure[RW]
stop_procedure[RW]
worker_executable_path[RW]

Public Class Methods

new() click to toggle source
# 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

Public Instance Methods

adapter=(adapter) click to toggle source
# File lib/scale_workers/configuration.rb, line 28
def adapter=(adapter)
  require "scale_workers/adapter/#{adapter}"
  @adapter = "ScaleWorkers::Adapter::#{adapter.classify}".constantize.new
end