Class: GarbageMan::Config
- Inherits:
-
Object
- Object
- GarbageMan::Config
- 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
Class Method Summary collapse
- .check_request_queue=(val) ⇒ Object
- .check_request_queue? ⇒ Boolean
- .enable_gc_file ⇒ Object
- .gc_config ⇒ Object
- .gc_health_check_request_path ⇒ Object
- .gc_last_collected_file ⇒ Object
- .gc_last_collected_file=(file) ⇒ Object
- .gc_sleep ⇒ Object
- .gc_sleep=(v) ⇒ Object
- .gc_starts ⇒ Object
- .gc_starts=(v) ⇒ Object
- .gc_yaml_file ⇒ Object
- .gc_yaml_file=(file) ⇒ Object
- .gc_yaml_tmp_file ⇒ Object
- .gc_yaml_tmp_file=(file) ⇒ Object
- .max_connection_drain_time ⇒ Object
- .max_connection_drain_time=(time) ⇒ Object
- .max_time_without_gc ⇒ Object
- .max_time_without_gc=(time) ⇒ Object
- .min_servers_to_disable_gc ⇒ Object
- .min_servers_to_disable_gc=(n) ⇒ Object
- .num_request_before_collecting ⇒ Object
- .num_request_before_collecting=(val) ⇒ Object
- .num_request_before_selecting_next_server ⇒ Object
- .num_request_before_selecting_next_server=(n) ⇒ Object
- .thin_config ⇒ Object
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
38 |
# File 'lib/garbageman/config.rb', line 38 def self.check_request_queue?; @@check_request_queue; end |
.enable_gc_file ⇒ Object
30 |
# File 'lib/garbageman/config.rb', line 30 def self.enable_gc_file; @@enable_gc_file; end |
.gc_config ⇒ Object
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_path ⇒ Object
4 |
# File 'lib/garbageman/config.rb', line 4 def self.gc_health_check_request_path; @@gc_health_check_request_path; end |
.gc_last_collected_file ⇒ Object
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_sleep ⇒ Object
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_starts ⇒ Object
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_file ⇒ Object
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_file ⇒ Object
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_time ⇒ Object
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_gc ⇒ Object
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_gc ⇒ Object
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_collecting ⇒ Object
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_server ⇒ Object
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_config ⇒ Object
27 |
# File 'lib/garbageman/config.rb', line 27 def self.thin_config; @@thin_config ||= YAML.load_file("./config/thin.yml"); end |