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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e456b67daee462454a91d41bfb7bffeb4bbbba00
4
- data.tar.gz: 3a94a780936d276e6a2e7f224d107119760927d3
3
+ metadata.gz: e7666ff9f482c8991bae14cb85e3353ea0c9faba
4
+ data.tar.gz: 546ab0f6f6318a8fa0c21bb7824c41cf793da90c
5
5
  SHA512:
6
- metadata.gz: f14abe4c4b39b0e6558eb4a61d46d815b98c8886687fb5bf6604d5994505e642ba90934638b15cf7d9868fe3d046f12976c3409029fe4ca6fe8bb7c3a6a9971b
7
- data.tar.gz: dd36f2c2b63d3614b4f969349867150486184f72ee626c47985e88bc364a35b2b3ef61ac97844e602e66fc563181839174a90351366b48ed54a84ee35d2b657f
6
+ metadata.gz: 6904f061c5ad93e04c409be6d24160709481e504fb3c8fec87b90cd465310b41a526935e307ea4f523254374efe731124c03c5d9cf4a9731b401be0e63d8752c
7
+ data.tar.gz: 73b5b85a0c6e8e5b2a19c0b330c2bebfc03f06bd8ac5a309ed90849c66f95be53eb26483db57ef4df4cab97da51c138165383a2e00f53834f8fa74a9d338b3a0
@@ -10,6 +10,7 @@ rvm:
10
10
  - 2.2.2
11
11
  - 2.2.3
12
12
  - 2.3.0
13
+ - 2.3.1
13
14
  - ruby-head
14
15
  script: "bundle exec rake"
15
16
  env: RUBY_GC_TUNE=200 RUBY_GC_TUNE_DEBUG=1 RUBY_GC_SYNC_ALWAYS=1
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
  ![tunemygc workflow diagram](https://raw.githubusercontent.com/bear-metal/tunemygc/master/assets/tunemygc-graphic2x-b3390590eadab5528577f4e0285330fd.png?token=AAABe8sM_ofiQkrCpNw7OYRbtHMLO9l5ks5UuQlYwA%3D%3D)
10
10
 
11
- We also recently [blogged](http://bearmetal.eu/theden/2015-02-20-rails-garbage-collection-tuning-approaches) about how the product works.
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
 
@@ -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 ENV["RUBY_GC_TUNE"] && ENV["RUBY_GC_TUNE"] != ""
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
@@ -41,7 +41,7 @@ module TuneMyGc
41
41
  end
42
42
 
43
43
  def log(message)
44
- logger.info "[tunemygc, pid: #{Process.pid}] #{message}"
44
+ logger.info "[tunemygc, ppid: #{Process.ppid}, pid: #{Process.pid}] #{message}"
45
45
  end
46
46
 
47
47
  def spy_ids
@@ -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, ObjectSpace.count_objects.merge(:memsize => ObjectSpace.memsize_of_all))
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
@@ -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}")
@@ -45,7 +45,7 @@ module TuneMyGc
45
45
 
46
46
  private
47
47
  def thread_id
48
- if Thread.current == Thread.main
48
+ if Thread.current != Thread.main
49
49
  Thread.current.object_id
50
50
  end
51
51
  end
@@ -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"
@@ -11,8 +11,6 @@ module TuneMyGc
11
11
  end
12
12
 
13
13
  def uninstall
14
- TuneMyGc.uninstall_gc_tracepoint
15
- TuneMyGc.log "uninstalled GC tracepoint"
16
14
  ::ActiveJob::Base.__send__(:include, disabled_hooks_module)
17
15
  TuneMyGc.log "uninstalled active_job spy"
18
16
  end
@@ -25,8 +25,6 @@ module TuneMyGc
25
25
  end
26
26
 
27
27
  def uninstall
28
- TuneMyGc.uninstall_gc_tracepoint
29
- TuneMyGc.log "uninstalled GC tracepoint"
30
28
  Delayed::Worker.plugins.delete(Delayed::Plugins::TuneMyGcPlugin)
31
29
  TuneMyGc.log "uninstalled delayed_job spy"
32
30
  end
@@ -11,8 +11,6 @@ module TuneMyGc
11
11
  end
12
12
 
13
13
  def uninstall
14
- TuneMyGc.uninstall_gc_tracepoint
15
- TuneMyGc.log "uninstalled GC tracepoint"
16
14
  MiniTest::Unit::TestCase.__send__(:include, disabled_hooks_module)
17
15
  TuneMyGc.log "uninstalled minitest spy"
18
16
  end
@@ -11,8 +11,6 @@ module TuneMyGc
11
11
  end
12
12
 
13
13
  def uninstall
14
- TuneMyGc.uninstall_gc_tracepoint
15
- TuneMyGc.log "uninstalled GC tracepoint"
16
14
  ::Que::Job.__send__(:include, TuneMyGc::Spies::QueJob::DisabledHooks)
17
15
  TuneMyGc.log "uninstalled que_job spy"
18
16
  end
@@ -15,8 +15,6 @@ module TuneMyGc
15
15
  end
16
16
 
17
17
  def uninstall
18
- TuneMyGc.uninstall_gc_tracepoint
19
- TuneMyGc.log "uninstalled GC tracepoint"
20
18
  RSpec::Core.__send__(:include, disabled_hooks_module)
21
19
  TuneMyGc.log "uninstalled rspec spy"
22
20
  end
@@ -92,8 +92,7 @@ module TuneMyGc
92
92
  TuneMyGc.log "Unknown error: #{response.body}"
93
93
  return false
94
94
  end
95
- rescue Timeout::Error, Errno::ETIMEDOUT, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED,
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
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module TuneMyGc
4
- VERSION = "1.0.65"
4
+ VERSION = "1.0.67"
5
5
  end
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.65
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-03-08 00:00:00.000000000 Z
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.4.5
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: