garbageman 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/garbageman.gemspec +1 -1
- data/lib/garbageman/collector.rb +2 -2
- data/lib/garbageman/config.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Mzk3YTcxM2I0Mjk1Mjk4NjdmNjlmYzY1YzI2OTY4NzEwZGE1M2I4NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjgyMDMwOTg3N2QyYzNmYjBjNmRiNmVjY2M0NmZmMDAwYzI3ZDFjMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGI0OWUwOWMzZTdjYTVhMjZjYTEwMWUxODUyZmFhZWJmYzdhNjk0MzhhZTVl
|
10
|
+
YWI2YjdhODUxMjkxOWFkZjk2Nzk2OTVhMzQ4ZDk4NjdjNDllZGMxYTViYjQ2
|
11
|
+
MjE2ZjUyMGVhMjBiNThhYjkyN2Q5ZDBmZTEyYjljMGQ2YmM4NTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTQ2NjQ1MTNlNGFjOTgyZDYyMTBlYTQyMjk1ZTNkMzAyNDg1MmRiYmRjZWIx
|
14
|
+
MGFhMjE1ZTMyNzI3ZDFmYmI3N2FkY2MyYzAyMGIxMGFjZWJlNDM2ZTgzNDU4
|
15
|
+
MzlmM2YzMzYyNWIxYzFkYTkyY2QxZDRjNjI1MWE2ZjI5MmMxMDM=
|
data/garbageman.gemspec
CHANGED
data/lib/garbageman/collector.rb
CHANGED
@@ -93,7 +93,7 @@ module GarbageMan
|
|
93
93
|
debug "starting gc"
|
94
94
|
starts = Time.now
|
95
95
|
GC.enable
|
96
|
-
GC.start
|
96
|
+
Config.gc_starts.times { GC.start; sleep Config.gc_sleep }
|
97
97
|
@last_gc_finished_at = Time.now
|
98
98
|
diff = (@last_gc_finished_at - starts) * 1000
|
99
99
|
info "GC took #{'%.2f' % diff}ms for #{@request_count} requests" if @show_gc_times
|
@@ -114,7 +114,7 @@ module GarbageMan
|
|
114
114
|
|
115
115
|
def create_gc_yaml
|
116
116
|
return unless server_index
|
117
|
-
return if File.exists?(Config.gc_yaml_file)
|
117
|
+
return if File.exists?(Config.gc_yaml_file) && ! current_server?
|
118
118
|
write_gc_yaml server_index, SELECTED
|
119
119
|
end
|
120
120
|
|
data/lib/garbageman/config.rb
CHANGED
@@ -56,5 +56,13 @@ module GarbageMan
|
|
56
56
|
@@max_connection_drain_time = 60
|
57
57
|
def self.max_connection_drain_time; @@max_connection_drain_time; end
|
58
58
|
def self.max_connection_drain_time=(time); @@max_connection_drain_time = time; end
|
59
|
+
|
60
|
+
@@gc_starts = 20
|
61
|
+
def self.gc_starts; @@gc_starts; end
|
62
|
+
def self.gc_starts=(v); @@gc_starts = v; end
|
63
|
+
|
64
|
+
@@gc_sleep = 0.05
|
65
|
+
def self.gc_sleep; @@gc_sleep; end
|
66
|
+
def self.gc_sleep=(v); @@gc_sleep = v; end
|
59
67
|
end
|
60
68
|
end
|