tunemygc 1.0.35 → 1.0.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -16
- data/lib/tunemygc/spies/action_controller.rb +0 -11
- data/lib/tunemygc/spies/active_job.rb +0 -11
- data/lib/tunemygc/spies/base.rb +8 -1
- data/lib/tunemygc/spies/manual.rb +0 -3
- data/lib/tunemygc/spies/minitest.rb +0 -11
- data/lib/tunemygc/spies/rspec.rb +0 -11
- data/lib/tunemygc/version.rb +1 -1
- data/test/test_action_controller_interposer.rb +2 -2
- data/test/test_activejob_interposer.rb +2 -2
- data/test/test_minitest_interposer.rb +2 -2
- data/tunemygc.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9efea5ec786e2f04a13f2a60b185badf347f8a30
|
4
|
+
data.tar.gz: 10136f7a07a6b22164280a6c21f14ef22a6ea3c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 648b160d4a42e29716007b54ae1ddfc38c41e2d6d10aa4a13d4c5d44478a6d567cf84131fb4c7f57c01378381d8df0ebadb7121d863976bc72d882216f971e4d
|
7
|
+
data.tar.gz: ae263f9109643864d4271cf530e9cfdc8e078895cb668bc53ed140d8f1e7f0d271144113e8b51c05dddbdcb0c5253870c5c96ae93e57cb3caf0cb184208f1163
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ We require a valid email address as a canonical reference for tuner tokens for y
|
|
52
52
|
For the above command sequences, to sample your app or script for tuning, run (inject `RUBY_GC_TOKEN` and `RUBY_GC_TUNE` to your env):
|
53
53
|
|
54
54
|
``` sh
|
55
|
-
RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d51 RUBY_GC_TUNE=
|
55
|
+
RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d51 RUBY_GC_TUNE=200 bundle exec rails s
|
56
56
|
```
|
57
57
|
|
58
58
|
And after some profiling requests, when the process terminates, you can visit the given report URL for a config recommendation and some further insights:
|
@@ -88,14 +88,14 @@ $ bundle exec tunemygc -r lourens@bearmetal.eu
|
|
88
88
|
Application registered. Use RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d51 in your environment.
|
89
89
|
```
|
90
90
|
|
91
|
-
* `RUBY_GC_TUNE=
|
91
|
+
* `RUBY_GC_TUNE=200`
|
92
92
|
|
93
|
-
Enables the interposer for
|
93
|
+
Enables the interposer and controls it's lifetime for sampling processing. It takes a few lightweight snapshots and submits them to `tunemygc.com`. A value of `200` implies `200` units of work - Rails requests, tests, background jobs etc. Without this environment variable set, it won't interpose itself. A good minimum ballpark sample set would be 200.
|
94
94
|
|
95
95
|
For the above command sequences, to sample a Rails app for tuning, run:
|
96
96
|
|
97
97
|
``` sh
|
98
|
-
RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d51 RUBY_GC_TUNE=
|
98
|
+
RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d51 RUBY_GC_TUNE=200 bundle exec rails s
|
99
99
|
```
|
100
100
|
|
101
101
|
And after some profiling requests, when the process terminates, you can visit the given report URL for a config recommendation and some further insights:
|
@@ -112,18 +112,6 @@ And after some profiling requests, when the process terminates, you can visit th
|
|
112
112
|
|
113
113
|
Defines what type of processing you would like to sample for GC activity. An Action Controller spy is the default, but [ActiveJob](https://github.com/rails/rails/tree/master/activejob), [minitest](https://github.com/seattlerb/minitest) and [rspec](http://rspec.info) are also supported as experimental features.
|
114
114
|
|
115
|
-
* `RUBY_GC_TUNE_REQUESTS=x` (a numeric value eg. `200`)
|
116
|
-
|
117
|
-
Controls the interposer lifetime for sampling Rails requests. It will enable itself, then remove request instrumentation after the specified number of requests. A good minimum ballpark sample set would be 200.
|
118
|
-
|
119
|
-
* `RUBY_GC_TUNE_JOBS=x` (a numeric value eg. `200`)
|
120
|
-
|
121
|
-
Controls the interposer lifetime for sampling ActiveJob jobs. It will enable itself, then remove job instrumentation after the specified number of jobs were processed. A good minimum ballpark sample set would be 200.
|
122
|
-
|
123
|
-
* `RUBY_GC_TUNE_TESTS=x` (a numeric value eg. `200`)
|
124
|
-
|
125
|
-
Controls the interposer lifetime for sampling a [minitest](https://github.com/seattlerb/minitest) or [rspec](http://rspec.info) based test suite. It will enable itself, then remove request instrumentation after the specified number of tests has been run. A good minimum ballpark sample set would be 200.
|
126
|
-
|
127
115
|
## How do I use this?
|
128
116
|
|
129
117
|
This gem is only a lightweight agent and designed to not get in your way. It samples your application during runtime, syncs data with our web service when it terminates and we provide a report URL where you can view a suggested GC configuration and additional tips and insights.
|
@@ -50,17 +50,6 @@ module TuneMyGc
|
|
50
50
|
TuneMyGc.log "uninstalled action_controller spy"
|
51
51
|
end
|
52
52
|
|
53
|
-
def check_uninstall
|
54
|
-
if ENV["RUBY_GC_TUNE_REQUESTS"]
|
55
|
-
@limit ||= Integer(ENV["RUBY_GC_TUNE_REQUESTS"])
|
56
|
-
@processed += 1
|
57
|
-
if @processed == @limit
|
58
|
-
uninstall
|
59
|
-
TuneMyGc.log "kamikaze after #{@processed} of #{@limit} requests"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
53
|
private
|
65
54
|
def subscription(pattern, handler)
|
66
55
|
@subscriptions << ActiveSupport::Notifications.subscribe(pattern, handler)
|
@@ -17,17 +17,6 @@ module TuneMyGc
|
|
17
17
|
TuneMyGc.log "uninstalled active_job spy"
|
18
18
|
end
|
19
19
|
|
20
|
-
def check_uninstall
|
21
|
-
if ENV["RUBY_GC_TUNE_JOBS"]
|
22
|
-
@limit ||= Integer(ENV["RUBY_GC_TUNE_JOBS"])
|
23
|
-
@processed += 1
|
24
|
-
if @processed == @limit
|
25
|
-
uninstall
|
26
|
-
TuneMyGc.log "kamikaze after #{@processed} of #{@limit} jobs"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
20
|
def hooks_module
|
32
21
|
Module.new do
|
33
22
|
def self.included(base)
|
data/lib/tunemygc/spies/base.rb
CHANGED
@@ -17,7 +17,14 @@ module TuneMyGc
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def check_uninstall
|
20
|
-
|
20
|
+
if ENV["RUBY_GC_TUNE"]
|
21
|
+
@limit ||= Integer(ENV["RUBY_GC_TUNE"])
|
22
|
+
@processed += 1
|
23
|
+
if @processed == @limit
|
24
|
+
uninstall
|
25
|
+
TuneMyGc.log "kamikaze after #{@processed} of #{@limit} units of work"
|
26
|
+
end
|
27
|
+
end
|
21
28
|
end
|
22
29
|
end
|
23
30
|
end
|
@@ -17,17 +17,6 @@ module TuneMyGc
|
|
17
17
|
TuneMyGc.log "uninstalled minitest spy"
|
18
18
|
end
|
19
19
|
|
20
|
-
def check_uninstall
|
21
|
-
if ENV["RUBY_GC_TUNE_TESTS"]
|
22
|
-
@limit ||= Integer(ENV["RUBY_GC_TUNE_TESTS"])
|
23
|
-
@processed += 1
|
24
|
-
if @processed == @limit
|
25
|
-
uninstall
|
26
|
-
TuneMyGc.log "kamikaze after #{@processed} of #{@limit} tests"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
20
|
def hooks_module
|
32
21
|
Module.new do
|
33
22
|
def before_setup
|
data/lib/tunemygc/spies/rspec.rb
CHANGED
@@ -21,17 +21,6 @@ module TuneMyGc
|
|
21
21
|
TuneMyGc.log "uninstalled rspec spy"
|
22
22
|
end
|
23
23
|
|
24
|
-
def check_uninstall
|
25
|
-
if ENV["RUBY_GC_TUNE_TESTS"]
|
26
|
-
@limit ||= Integer(ENV["RUBY_GC_TUNE_TESTS"])
|
27
|
-
@processed += 1
|
28
|
-
if @processed == @limit
|
29
|
-
uninstall
|
30
|
-
TuneMyGc.log "kamikaze after #{@processed} of #{@limit} tests"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
24
|
def hooks_module
|
36
25
|
Module.new do
|
37
26
|
RSpec.configure do |c|
|
data/lib/tunemygc/version.rb
CHANGED
@@ -56,7 +56,7 @@ class TestActionControllerInterposer < TuneMyGcTestCase
|
|
56
56
|
|
57
57
|
assert_equal 2, interposer.spy.subscriptions.size
|
58
58
|
|
59
|
-
ENV["
|
59
|
+
ENV["RUBY_GC_TUNE"] = "2"
|
60
60
|
|
61
61
|
process_tunemygc_request
|
62
62
|
assert_equal 2, interposer.spy.subscriptions.size
|
@@ -75,7 +75,7 @@ class TestActionControllerInterposer < TuneMyGcTestCase
|
|
75
75
|
|
76
76
|
interposer.uninstall
|
77
77
|
ensure
|
78
|
-
ENV
|
78
|
+
ENV["RUBY_GC_TUNE"] = "1"
|
79
79
|
end
|
80
80
|
|
81
81
|
def process_tunemygc_request(path = '/test')
|
@@ -63,7 +63,7 @@ class TestActiveJobInterposer < TuneMyGcTestCase
|
|
63
63
|
interposer.install
|
64
64
|
TuneMyGc.interposer.on_initialized
|
65
65
|
|
66
|
-
ENV["
|
66
|
+
ENV["RUBY_GC_TUNE"] = "2"
|
67
67
|
|
68
68
|
run_tunemygc_job
|
69
69
|
run_tunemygc_job
|
@@ -80,7 +80,7 @@ class TestActiveJobInterposer < TuneMyGcTestCase
|
|
80
80
|
|
81
81
|
interposer.uninstall
|
82
82
|
ensure
|
83
|
-
ENV
|
83
|
+
ENV["RUBY_GC_TUNE"] = "1"
|
84
84
|
end
|
85
85
|
|
86
86
|
def run_tunemygc_job
|
@@ -67,7 +67,7 @@ class TestMinitestInterposer < TuneMyGcTestCase
|
|
67
67
|
interposer.install
|
68
68
|
TuneMyGc.interposer.on_initialized
|
69
69
|
|
70
|
-
ENV["
|
70
|
+
ENV["RUBY_GC_TUNE"] = "2"
|
71
71
|
|
72
72
|
run_tunemygc_test
|
73
73
|
run_tunemygc_test
|
@@ -84,7 +84,7 @@ class TestMinitestInterposer < TuneMyGcTestCase
|
|
84
84
|
|
85
85
|
interposer.uninstall
|
86
86
|
ensure
|
87
|
-
ENV
|
87
|
+
ENV["RUBY_GC_TUNE"] = "1"
|
88
88
|
end
|
89
89
|
|
90
90
|
def run_tunemygc_test
|
data/tunemygc.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
|
35
35
|
Then sample your Rails app for tuning:
|
36
36
|
|
37
|
-
$ RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d32 RUBY_GC_TUNE=
|
37
|
+
$ RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d32 RUBY_GC_TUNE=200 bundle exec rails s
|
38
38
|
|
39
39
|
We require a valid email address as a canonical reference for tuner tokens for your applications.
|
40
40
|
|
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.36
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: certified
|
@@ -180,7 +180,7 @@ post_install_message: |2
|
|
180
180
|
|
181
181
|
Then sample your Rails app for tuning:
|
182
182
|
|
183
|
-
$ RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d32 RUBY_GC_TUNE=
|
183
|
+
$ RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d32 RUBY_GC_TUNE=200 bundle exec rails s
|
184
184
|
|
185
185
|
We require a valid email address as a canonical reference for tuner tokens for your applications.
|
186
186
|
|