tunemygc 1.0.46 → 1.0.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/assets/tunemygc-graphic2x-b3390590eadab5528577f4e0285330fd.png +0 -0
- data/lib/tunemygc/agent.rb +3 -3
- data/lib/tunemygc/interposer.rb +11 -7
- data/lib/tunemygc/spies.rb +8 -4
- data/lib/tunemygc/syncer.rb +1 -1
- data/lib/tunemygc/version.rb +1 -1
- data/test/test_activejob_interposer.rb +5 -5
- data/test/test_agent.rb +6 -3
- data/test/test_minitest_interposer.rb +5 -5
- metadata +3 -3
- data/assets/tunemygc-graphic2x-80dac1571cacc70d9b272bb62ae9f6df.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdd4781423af377b02af2c99a16794cdec61e12e
|
4
|
+
data.tar.gz: b5c7fc03f4693a1d2ccc3015b1363fe4b1da4e6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdb95cbb93251ff6ecfa865ebf058c2be1d28a69177513973bbdb4a9b5303ebf2f6bb8477a9c7ef0abb1fb5f990726f3656366e3de995412f210a229c0c7b9eb
|
7
|
+
data.tar.gz: b3e123b1e316e8b35ff1d475b1c849b73f2cdfb38b7bdc594c6aaf91a3089cd4cec5c33f218e12652331768b26488c8b3c645531cf806c04c4ade350d93297b6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@ The Ruby garbage collector has been flagged as the crux of Ruby performance and
|
|
6
6
|
|
7
7
|
## We're fixing this
|
8
8
|
|
9
|
-
![tunemygc workflow diagram](https://raw.githubusercontent.com/bear-metal/tunemygc/master/assets/tunemygc-graphic2x-
|
9
|
+
![tunemygc workflow diagram](https://raw.githubusercontent.com/bear-metal/tunemygc/master/assets/tunemygc-graphic2x-b3390590eadab5528577f4e0285330fd.png?token=AAABe8sM_ofiQkrCpNw7OYRbtHMLO9l5ks5UuQlYwA%3D%3D)
|
10
10
|
|
11
11
|
We also recently [blogged](http://bearmetal.eu/theden/2015-02-20-rails-garbage-collection-tuning-approaches) about how the product works.
|
12
12
|
|
Binary file
|
data/lib/tunemygc/agent.rb
CHANGED
data/lib/tunemygc/interposer.rb
CHANGED
@@ -4,12 +4,16 @@ require 'tunemygc/spies'
|
|
4
4
|
|
5
5
|
module TuneMyGc
|
6
6
|
class Interposer
|
7
|
-
attr_reader :
|
7
|
+
attr_reader :spies
|
8
8
|
attr_accessor :installed
|
9
9
|
|
10
|
-
def initialize(
|
10
|
+
def initialize(spies = TuneMyGc.spies)
|
11
11
|
reset
|
12
|
-
@
|
12
|
+
@spies = spies.map{|s| TuneMyGc::Spies.const_get(s).new }
|
13
|
+
end
|
14
|
+
|
15
|
+
def spy
|
16
|
+
@spies.first
|
13
17
|
end
|
14
18
|
|
15
19
|
def on_initialized
|
@@ -17,7 +21,7 @@ module TuneMyGc
|
|
17
21
|
TuneMyGc.install_gc_tracepoint
|
18
22
|
TuneMyGc.log "hooked: GC tracepoints"
|
19
23
|
TuneMyGc.snapshot(:BOOTED)
|
20
|
-
TuneMyGc.interposer.
|
24
|
+
TuneMyGc.interposer.spies.each{|s| s.install }
|
21
25
|
end
|
22
26
|
|
23
27
|
def install
|
@@ -36,7 +40,7 @@ module TuneMyGc
|
|
36
40
|
at_exit do
|
37
41
|
if @installed
|
38
42
|
TuneMyGc.log "at_exit"
|
39
|
-
@
|
43
|
+
@spies.each{|s| s.uninstall }
|
40
44
|
TuneMyGc.snapshot(:TERMINATED)
|
41
45
|
TuneMyGc.reccommendations
|
42
46
|
end
|
@@ -47,13 +51,13 @@ module TuneMyGc
|
|
47
51
|
end
|
48
52
|
|
49
53
|
def check_uninstall
|
50
|
-
@
|
54
|
+
@spies.each{|s| s.check_uninstall }
|
51
55
|
end
|
52
56
|
|
53
57
|
def uninstall
|
54
58
|
TuneMyGc.uninstall_gc_tracepoint
|
55
59
|
TuneMyGc.log "uninstalled GC tracepoint"
|
56
|
-
@
|
60
|
+
@spies.each{|s| s.uninstall }
|
57
61
|
reset
|
58
62
|
end
|
59
63
|
|
data/lib/tunemygc/spies.rb
CHANGED
@@ -15,15 +15,19 @@ module TuneMyGc
|
|
15
15
|
spy :Rspec, 'rspec'
|
16
16
|
spy :QueJob, 'que_job'
|
17
17
|
|
18
|
-
def self.
|
19
|
-
|
18
|
+
def self.ids
|
19
|
+
current.map do |spy|
|
20
|
+
@spies.key(spy)
|
21
|
+
end.join(',')
|
20
22
|
end
|
21
23
|
|
22
24
|
def self.current
|
23
25
|
if ENV['RUBY_GC_SPY']
|
24
|
-
|
26
|
+
ENV['RUBY_GC_SPY'].split(",").map do |spy|
|
27
|
+
@spies[spy] || raise(NotImplementedError, "TuneMyGC spy #{spy} not supported. Valid spies are #{@spies.keys}")
|
28
|
+
end
|
25
29
|
else
|
26
|
-
TuneMyGc.rails? ? 'ActionController' : 'Manual'
|
30
|
+
[(TuneMyGc.rails? ? 'ActionController' : 'Manual')]
|
27
31
|
end
|
28
32
|
end
|
29
33
|
end
|
data/lib/tunemygc/syncer.rb
CHANGED
@@ -59,7 +59,7 @@ module TuneMyGc
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def environment(snapshotter)
|
62
|
-
ENVIRONMENT.dup.concat([snapshotter.stat_keys, TuneMyGc.
|
62
|
+
ENVIRONMENT.dup.concat([snapshotter.stat_keys, TuneMyGc.spy_ids, Socket.gethostname, Process.ppid, Process.pid])
|
63
63
|
end
|
64
64
|
|
65
65
|
private
|
data/lib/tunemygc/version.rb
CHANGED
@@ -14,17 +14,17 @@ class TestActiveJobInterposer < TuneMyGcTestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def teardown
|
17
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActionController)
|
17
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActionController])
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_init
|
21
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActiveJob)
|
21
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActiveJob])
|
22
22
|
interposer = TuneMyGc.interposer
|
23
23
|
assert !interposer.installed
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_install_uninstall
|
27
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActiveJob)
|
27
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActiveJob])
|
28
28
|
interposer = TuneMyGc.interposer
|
29
29
|
interposer.install
|
30
30
|
interposer.on_initialized
|
@@ -35,7 +35,7 @@ class TestActiveJobInterposer < TuneMyGcTestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_gc_hooks
|
38
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActiveJob)
|
38
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActiveJob])
|
39
39
|
interposer = TuneMyGc.interposer
|
40
40
|
interposer.install
|
41
41
|
TuneMyGc.interposer.on_initialized
|
@@ -58,7 +58,7 @@ class TestActiveJobInterposer < TuneMyGcTestCase
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_tests_limit
|
61
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActiveJob)
|
61
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActiveJob])
|
62
62
|
interposer = TuneMyGc.interposer
|
63
63
|
interposer.install
|
64
64
|
TuneMyGc.interposer.on_initialized
|
data/test/test_agent.rb
CHANGED
@@ -12,10 +12,13 @@ class TestAgent < TuneMyGcTestCase
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_spy
|
15
|
-
assert_equal 'ActionController', TuneMyGc.
|
15
|
+
assert_equal ['ActionController'], TuneMyGc.spies
|
16
16
|
ENV['RUBY_GC_SPY'] = "minitest"
|
17
|
-
assert_equal 'Minitest', TuneMyGc.
|
18
|
-
assert_equal 'minitest', TuneMyGc.
|
17
|
+
assert_equal ['Minitest'], TuneMyGc.spies
|
18
|
+
assert_equal 'minitest', TuneMyGc.spy_ids
|
19
|
+
ENV['RUBY_GC_SPY'] = "action_controller,active_job"
|
20
|
+
assert_equal ['ActionController','ActiveJob'], TuneMyGc.spies
|
21
|
+
assert_equal 'action_controller,active_job', TuneMyGc.spy_ids
|
19
22
|
ensure
|
20
23
|
ENV.delete('RUBY_GC_SPY')
|
21
24
|
end
|
@@ -18,17 +18,17 @@ class TestMinitestInterposer < TuneMyGcTestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def teardown
|
21
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:ActionController)
|
21
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:ActionController])
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_init
|
25
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:Minitest)
|
25
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:Minitest])
|
26
26
|
interposer = TuneMyGc.interposer
|
27
27
|
assert !interposer.installed
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_install_uninstall
|
31
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:Minitest)
|
31
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:Minitest])
|
32
32
|
interposer = TuneMyGc.interposer
|
33
33
|
interposer.install
|
34
34
|
interposer.on_initialized
|
@@ -39,7 +39,7 @@ class TestMinitestInterposer < TuneMyGcTestCase
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_gc_hooks
|
42
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:Minitest)
|
42
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:Minitest])
|
43
43
|
interposer = TuneMyGc.interposer
|
44
44
|
interposer.install
|
45
45
|
TuneMyGc.interposer.on_initialized
|
@@ -62,7 +62,7 @@ class TestMinitestInterposer < TuneMyGcTestCase
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_tests_limit
|
65
|
-
TuneMyGc.interposer = TuneMyGc::Interposer.new(:Minitest)
|
65
|
+
TuneMyGc.interposer = TuneMyGc::Interposer.new([:Minitest])
|
66
66
|
interposer = TuneMyGc.interposer
|
67
67
|
interposer.install
|
68
68
|
TuneMyGc.interposer.on_initialized
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tunemygc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bear Metal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -109,7 +109,7 @@ files:
|
|
109
109
|
- README.md
|
110
110
|
- Rakefile
|
111
111
|
- assets/discourse_bench.png
|
112
|
-
- assets/tunemygc-graphic2x-
|
112
|
+
- assets/tunemygc-graphic2x-b3390590eadab5528577f4e0285330fd.png
|
113
113
|
- bin/tunemygc
|
114
114
|
- doc/protocol.md
|
115
115
|
- ext/tunemygc/extconf.rb
|
Binary file
|