tunemygc 1.0.65 → 1.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +1 -1
- data/lib/tunemygc.rb +6 -2
- data/lib/tunemygc/agent.rb +1 -1
- data/lib/tunemygc/interposer.rb +2 -2
- data/lib/tunemygc/network.rb +2 -0
- data/lib/tunemygc/snapshotter.rb +1 -1
- data/lib/tunemygc/spies/action_controller.rb +0 -2
- data/lib/tunemygc/spies/active_job.rb +0 -2
- data/lib/tunemygc/spies/delayed_job.rb +0 -2
- data/lib/tunemygc/spies/minitest.rb +0 -2
- data/lib/tunemygc/spies/que_job.rb +0 -2
- data/lib/tunemygc/spies/rspec.rb +0 -2
- data/lib/tunemygc/syncer.rb +1 -2
- data/lib/tunemygc/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7666ff9f482c8991bae14cb85e3353ea0c9faba
|
4
|
+
data.tar.gz: 546ab0f6f6318a8fa0c21bb7824c41cf793da90c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6904f061c5ad93e04c409be6d24160709481e504fb3c8fec87b90cd465310b41a526935e307ea4f523254374efe731124c03c5d9cf4a9731b401be0e63d8752c
|
7
|
+
data.tar.gz: 73b5b85a0c6e8e5b2a19c0b330c2bebfc03f06bd8ac5a309ed90849c66f95be53eb26483db57ef4df4cab97da51c138165383a2e00f53834f8fa74a9d338b3a0
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -8,7 +8,7 @@ The Ruby garbage collector has been flagged as the crux of Ruby performance and
|
|
8
8
|
|
9
9
|

|
10
10
|
|
11
|
-
We also recently [blogged](
|
11
|
+
We also recently [blogged](https://bearmetal.eu/theden/rails-garbage-collection-tuning-approaches/) about how the product works.
|
12
12
|
|
13
13
|
## Benefits
|
14
14
|
|
data/lib/tunemygc.rb
CHANGED
@@ -19,9 +19,13 @@ module TuneMyGc
|
|
19
19
|
def self.run_silently?
|
20
20
|
!ENV['RUBY_GC_TUNE_VERBOSE'].nil? && ENV['RUBY_GC_TUNE_VERBOSE'].to_i == 0
|
21
21
|
end
|
22
|
+
|
23
|
+
def self.enabled?
|
24
|
+
ENV["RUBY_GC_TUNE"] && ENV["RUBY_GC_TUNE"] != ""
|
25
|
+
end
|
22
26
|
end
|
23
27
|
|
24
|
-
if
|
28
|
+
if TuneMyGc.enabled?
|
25
29
|
if TuneMyGc.rails?
|
26
30
|
puts "[tunemygc] Rails detected, loading railtie"
|
27
31
|
require 'tunemygc/railtie'
|
@@ -31,5 +35,5 @@ if ENV["RUBY_GC_TUNE"] && ENV["RUBY_GC_TUNE"] != ""
|
|
31
35
|
TuneMyGc.booted
|
32
36
|
end
|
33
37
|
else
|
34
|
-
puts "[tunemygc] not enabled" unless TuneMyGc.run_silently?
|
38
|
+
STDERR.puts "[tunemygc] not enabled" unless TuneMyGc.run_silently?
|
35
39
|
end
|
data/lib/tunemygc/agent.rb
CHANGED
data/lib/tunemygc/interposer.rb
CHANGED
@@ -20,7 +20,7 @@ module TuneMyGc
|
|
20
20
|
GC.start(full_mark: true, :immediate_sweep => true)
|
21
21
|
TuneMyGc.install_gc_tracepoint
|
22
22
|
TuneMyGc.log "hooked: GC tracepoints"
|
23
|
-
TuneMyGc.snapshot(:BOOTED,
|
23
|
+
TuneMyGc.snapshot(:BOOTED, TuneMyGc.count_objects)
|
24
24
|
TuneMyGc.interposer.spies.each{|s| s.install }
|
25
25
|
end
|
26
26
|
|
@@ -67,8 +67,8 @@ module TuneMyGc
|
|
67
67
|
TuneMyGc.log "kamikaze: synching #{TuneMyGc.snapshotter.size} GC sample snapshots ahead of time (usually only on process exit)"
|
68
68
|
Timeout.timeout(TuneMyGc::KAMIZE_SYNC_TIMEOUT) do
|
69
69
|
begin
|
70
|
+
uninstall
|
70
71
|
TuneMyGc.recommendations
|
71
|
-
reset
|
72
72
|
rescue Timeout::Error
|
73
73
|
# Discard the TERMINATED snapshot, retry in the at_exit block
|
74
74
|
TuneMyGc.snapshotter.deq
|
data/lib/tunemygc/network.rb
CHANGED
@@ -16,6 +16,8 @@ end
|
|
16
16
|
module TuneMyGc
|
17
17
|
NETWORK_TIMEOUT = 30 #seconds
|
18
18
|
KAMIZE_SYNC_TIMEOUT = 35 #seconds
|
19
|
+
NETWORK_ERRORS = [ Timeout::Error, Errno::ETIMEDOUT, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED,
|
20
|
+
EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError, IOError ]
|
19
21
|
|
20
22
|
def self.http_client
|
21
23
|
uri = URI("https://#{TuneMyGc::HOST}")
|
data/lib/tunemygc/snapshotter.rb
CHANGED
@@ -45,8 +45,6 @@ module TuneMyGc
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def uninstall
|
48
|
-
TuneMyGc.uninstall_gc_tracepoint
|
49
|
-
TuneMyGc.log "uninstalled GC tracepoint"
|
50
48
|
@subscriptions.each{|s| ActiveSupport::Notifications.unsubscribe(s) }
|
51
49
|
@subscriptions.clear
|
52
50
|
TuneMyGc.log "uninstalled action_controller spy"
|
data/lib/tunemygc/spies/rspec.rb
CHANGED
data/lib/tunemygc/syncer.rb
CHANGED
@@ -92,8 +92,7 @@ module TuneMyGc
|
|
92
92
|
TuneMyGc.log "Unknown error: #{response.body}"
|
93
93
|
return false
|
94
94
|
end
|
95
|
-
rescue
|
96
|
-
EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError, IOError => e
|
95
|
+
rescue *TuneMyGc::NETWORK_ERRORS => e
|
97
96
|
TuneMyGc.log "Failed to sync #{snapshots} snapshots (error: #{e})"
|
98
97
|
return :retryable
|
99
98
|
end
|
data/lib/tunemygc/version.rb
CHANGED
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.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bear Metal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
210
|
rubyforge_project:
|
211
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.5.1
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: TuneMyGC - optimal MRI Ruby 2.1+ Garbage Collection
|
@@ -225,4 +225,3 @@ test_files:
|
|
225
225
|
- test/test_railtie.rb
|
226
226
|
- test/test_snapshotter.rb
|
227
227
|
- test/test_syncer.rb
|
228
|
-
has_rdoc:
|