Class: GarbageMan::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/garbageman/config.rb

Constant Summary collapse

@@gc_health_check_request_path =
'/gc_health_check'
@@gc_yaml_file =
nil
@@gc_yaml_tmp_file =
nil
@@gc_last_collected_file =
nil
@@thin_config =
nil
@@enable_gc_file =
"./data/enable_gc"
@@num_request_before_collecting =
20
@@check_request_queue =

can configure to turn on gc if server starts queuing requests

false
@@num_request_before_selecting_next_server =

absolutely make sure we are in the pool again before selecting next server

5
@@min_servers_to_disable_gc =
3
@@max_time_without_gc =

if we have not GC in 40 seconds turn back on GC

60
@@max_connection_drain_time =

max time to wait for connections to drain

60
@@gc_starts =
1
@@gc_sleep =
0.00
@@time_to_wait_before_collecting =

after selected and connections are drained, wait this many seconds before collecting so that all proxies are aware that this process will collect

2.0

Class Method Summary collapse

Class Method Details

.check_request_queue=(val) ⇒ Object



39
# File 'lib/garbageman/config.rb', line 39

def self.check_request_queue=(val); @@check_request_queue = val; end

.check_request_queue?Boolean

Returns:

  • (Boolean)


38
# File 'lib/garbageman/config.rb', line 38

def self.check_request_queue?; @@check_request_queue; end

.enable_gc_fileObject



30
# File 'lib/garbageman/config.rb', line 30

def self.enable_gc_file; @@enable_gc_file; end

.gc_configObject



18
19
20
21
22
23
24
# File 'lib/garbageman/config.rb', line 18

def self.gc_config
  begin
    File.exists?(self.gc_yaml_file) ? YAML.load_file(self.gc_yaml_file) : nil
  rescue Exception => e
    nil
  end
end

.gc_health_check_request_pathObject



4
# File 'lib/garbageman/config.rb', line 4

def self.gc_health_check_request_path; @@gc_health_check_request_path; end

.gc_last_collected_fileObject



15
# File 'lib/garbageman/config.rb', line 15

def self.gc_last_collected_file; @@gc_last_collected_file ||= "./data/gc-last-collection-time.timestamp"; end

.gc_last_collected_file=(file) ⇒ Object



16
# File 'lib/garbageman/config.rb', line 16

def self.gc_last_collected_file=(file); @@gc_last_collected_file = file; end

.gc_sleepObject



65
# File 'lib/garbageman/config.rb', line 65

def self.gc_sleep; @@gc_sleep; end

.gc_sleep=(v) ⇒ Object



66
# File 'lib/garbageman/config.rb', line 66

def self.gc_sleep=(v); @@gc_sleep = v || 10; end

.gc_startsObject



61
# File 'lib/garbageman/config.rb', line 61

def self.gc_starts; @@gc_starts; end

.gc_starts=(v) ⇒ Object



62
# File 'lib/garbageman/config.rb', line 62

def self.gc_starts=(v); @@gc_starts = v; end

.gc_yaml_fileObject



7
# File 'lib/garbageman/config.rb', line 7

def self.gc_yaml_file; @@gc_yaml_file ||= "./data/gc.yml"; end

.gc_yaml_file=(file) ⇒ Object



8
# File 'lib/garbageman/config.rb', line 8

def self.gc_yaml_file=(file); @@gc_yaml_file = file; end

.gc_yaml_tmp_fileObject



11
# File 'lib/garbageman/config.rb', line 11

def self.gc_yaml_tmp_file; @@gc_yaml_tmp_file ||= "./data/.tmp.gc.yml"; end

.gc_yaml_tmp_file=(file) ⇒ Object



12
# File 'lib/garbageman/config.rb', line 12

def self.gc_yaml_tmp_file=(file); @@gc_yaml_tmp_file = file; end

.max_connection_drain_timeObject



57
# File 'lib/garbageman/config.rb', line 57

def self.max_connection_drain_time; @@max_connection_drain_time; end

.max_connection_drain_time=(time) ⇒ Object



58
# File 'lib/garbageman/config.rb', line 58

def self.max_connection_drain_time=(time); @@max_connection_drain_time = time; end

.max_time_without_gcObject



52
# File 'lib/garbageman/config.rb', line 52

def self.max_time_without_gc; @@max_time_without_gc; end

.max_time_without_gc=(time) ⇒ Object



53
# File 'lib/garbageman/config.rb', line 53

def self.max_time_without_gc=(time); @@max_time_without_gc = time; end

.min_servers_to_disable_gcObject



47
# File 'lib/garbageman/config.rb', line 47

def self.min_servers_to_disable_gc; @@min_servers_to_disable_gc; end

.min_servers_to_disable_gc=(n) ⇒ Object



48
# File 'lib/garbageman/config.rb', line 48

def self.min_servers_to_disable_gc=(n); @@min_servers_to_disable_gc = n; end

.num_request_before_collectingObject



33
# File 'lib/garbageman/config.rb', line 33

def self.num_request_before_collecting; @@num_request_before_collecting; end

.num_request_before_collecting=(val) ⇒ Object



34
# File 'lib/garbageman/config.rb', line 34

def self.num_request_before_collecting=(val); @@num_request_before_collecting = val; end

.num_request_before_selecting_next_serverObject



43
# File 'lib/garbageman/config.rb', line 43

def self.num_request_before_selecting_next_server; @@num_request_before_selecting_next_server; end

.num_request_before_selecting_next_server=(n) ⇒ Object



44
# File 'lib/garbageman/config.rb', line 44

def self.num_request_before_selecting_next_server=(n); @@num_request_before_selecting_next_server = n; end

.thin_configObject



27
# File 'lib/garbageman/config.rb', line 27

def self.thin_config; @@thin_config ||= YAML.load_file("./config/thin.yml"); end

.time_to_wait_before_collectingObject



71
# File 'lib/garbageman/config.rb', line 71

def self.time_to_wait_before_collecting; @@time_to_wait_before_collecting; end

.time_to_wait_before_collecting=(v) ⇒ Object



72
# File 'lib/garbageman/config.rb', line 72

def self.time_to_wait_before_collecting=(v); @@time_to_wait_before_collecting = v || 2.0; end