tunemygc 1.0.1 → 1.0.2

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: 4401c1469c2636840a42026092dcd8d682d8825f
4
- data.tar.gz: 5e44ddbc6336a4683b155393087bc8d39bc95cba
3
+ metadata.gz: 9fbad2da645aa2d033f78de306ebd504cca2c5ca
4
+ data.tar.gz: c7ece64385753be5dcd120103c952b40213eb907
5
5
  SHA512:
6
- metadata.gz: 294670fabab8fa5203a580b6a4182ebb888d83d52710dfe8f82fb5545b6daefdeb3dad21d72c16b7bc2c6f0f0b3cc5ccd73d65bac3512468dd1c383f21a58568
7
- data.tar.gz: 6bac1f88cad71533a4731332526dabc49e3b60b2d77c68a133dc7b6dea55ade00b8522cf372b2884777f572744028e70f59435303e27ac1ebfb1c3c8ad88f760
6
+ metadata.gz: 4a3a8bdcdae61551a2342fb4142434c2e1c0883a92667d26c4da71342d7b1a73ff9807ccfb8d274b2a7abad4cb4b52b071062ffbe0e5bc29500499d55e4a1fa5
7
+ data.tar.gz: d0cf1b7bbfee6f1bb9deba037a4ec61e57ca9eb9298664277ba76a6eb3cdf586c727662b02651d56c7b76090a17a856a86f9f9979b0d312c31f2cca61339b62d
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tunemygc (1.0)
5
- activesupport
6
- certified
4
+ tunemygc (1.0.1)
5
+ activesupport (~> 4.1)
6
+ certified (~> 1.0, >= 1.0.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -119,7 +119,7 @@ PLATFORMS
119
119
 
120
120
  DEPENDENCIES
121
121
  rails
122
- rake
123
- rake-compiler (~> 0.9.3)
122
+ rake (~> 10.3)
123
+ rake-compiler (~> 0.9, >= 0.9.5)
124
124
  tunemygc!
125
- webmock
125
+ webmock (~> 1.2, >= 1.2.0)
data/README.md CHANGED
@@ -29,7 +29,7 @@ We used [Discourse](http://www.discourse.org) as our primary test harness as it'
29
29
  Add to your Gemfile and run `bundle install`
30
30
 
31
31
  ``` sh
32
- gem 'tunemygc', :require => 'tunemygc'
32
+ gem 'tunemygc'
33
33
  ```
34
34
  This gem linterposes itself into the Rails request/response lifecycles and piggy backs off the new GC events in Ruby 2.x for introspection. Tuning recommendations are handled through a web service at `https://tunemygc.com`. You will need a `rails > 4.1`, installation and MRI Ruby `2.1`, or later.
35
35
 
@@ -91,13 +91,9 @@ RUBY_GC_TOKEN=08de9e8822c847244b31290cedfc1d51 RUBY_GC_TUNE=1 bundle exec rails
91
91
 
92
92
  #### Advanced
93
93
 
94
- * `RUBY_GC_TUNE_REQUESTS=x`
94
+ * `RUBY_GC_TUNE_REQUESTS=x` (a numeric value eg. `200`)
95
95
 
96
- Controls the interposer lifetime for sampling requests. It will enable itself, then remove request instrumentation after `x` requests. A good minimum ballpark sample set would be 200
97
-
98
- * `RUBY_GC_TUNE_DEBUG=1`
99
-
100
- As above, but dumps snapshots to Rails logger or STDOUT prior to submission. Mostly for developer use/support.
96
+ Controls the interposer lifetime for sampling requests. It will enable itself, then remove request instrumentation after the specified number of requests. A good minimum ballpark sample set would be 200.
101
97
 
102
98
  ## How do I use this?
103
99
 
@@ -163,7 +159,7 @@ We do however ask for a valid email address as a canonical reference for tuner t
163
159
 
164
160
  When trouble strikes, please file an [issue](https://www.github.com/bear-metal/tunemygc/issues) or email Lourens directly <lourens@bearmetal.eu>
165
161
 
166
- [Bear Metal](http://www.bearmetal.eu) is also available for consulting around general Rails performance, heap dump analysis (more tools coming soon) and custom Ruby extension development.
162
+ [Bear Metal](http://www.bearmetal.eu) is also available for consulting around general Rails performance, heap dump analysis (more tools coming soon) and custom Ruby extension development.
167
163
 
168
164
  ## License
169
165
 
@@ -171,7 +167,7 @@ When trouble strikes, please file an [issue](https://www.github.com/bear-metal/t
171
167
 
172
168
  Copyright (c) 2015:
173
169
 
174
- * [Bear Metal](http://bearmetal.eu)
170
+ * [Bear Metal](http://bearmetal.eu)
175
171
 
176
172
  Permission is hereby granted, free of charge, to any person obtaining
177
173
  a copy of this software and associated documentation files (the
data/lib/tunemygc/cli.rb CHANGED
@@ -7,7 +7,7 @@ require 'optparse'
7
7
 
8
8
  module TuneMyGc
9
9
  class CLI
10
- TIMEOUT = 10
10
+ TIMEOUT = 20
11
11
 
12
12
  attr_reader :uri, :client, :options
13
13
 
@@ -6,7 +6,7 @@ require 'timeout'
6
6
 
7
7
  module TuneMyGc
8
8
  class Syncer
9
- TIMEOUT = 10 #seconds
9
+ TIMEOUT = 20 #seconds
10
10
  ENVIRONMENT = [ENV['RUBY_GC_TOKEN'], RUBY_VERSION, Rails.version, ENV.select {|k,v| k =~ /RUBY_GC_/ }, TuneMyGc::VERSION, GC::OPTS, GC::INTERNAL_CONSTANTS].freeze
11
11
 
12
12
  attr_reader :uri, :client
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module TuneMyGc
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
data/test/test_syncer.rb CHANGED
@@ -29,7 +29,7 @@ class TestSyncer < TuneMyGcTestCase
29
29
 
30
30
  stub_request(:post, "https://tunemygc.com/ruby").
31
31
  with(:body => "[#{ActiveSupport::JSON.encode(TuneMyGc::Syncer::ENVIRONMENT)},[1420152606.1162581,\"BOOTED\",{\"count\":32,\"heap_used\":950,\"heap_length\":1519,\"heap_increment\":569,\"heap_live_slot\":385225,\"heap_free_slot\":2014,\"heap_final_slot\":0,\"heap_swept_slot\":101119,\"heap_eden_page_length\":950,\"heap_tomb_page_length\":0,\"total_allocated_object\":2184137,\"total_freed_object\":1798912,\"malloc_increase\":9665288,\"malloc_limit\":16777216,\"minor_gc_count\":26,\"major_gc_count\":6,\"remembered_shady_object\":5145,\"remembered_shady_object_limit\":6032,\"old_object\":230164,\"old_object_limit\":301030,\"oldmalloc_increase\":11715304,\"oldmalloc_limit\":24159190},{\"major_by\":null,\"gc_by\":\"newobj\",\"have_finalizer\":false,\"immediate_sweep\":false},null]]",
32
- :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'TuneMyGC 1.0'}).
32
+ :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>"TuneMyGC #{TuneMyGc::VERSION}"}).
33
33
  to_return(:status => 200, :body => "https://www.tunemygc.com/configs/xxxxxxx", :headers => {})
34
34
 
35
35
  out, err = capture_io do
@@ -47,7 +47,7 @@ class TestSyncer < TuneMyGcTestCase
47
47
  snapshots.take_raw(Fixtures::STAGE_BOOTED)
48
48
  stub_request(:post, "https://tunemygc.com/ruby").
49
49
  with(:body => "[#{ActiveSupport::JSON.encode(TuneMyGc::Syncer::ENVIRONMENT)},[1420152606.1162581,\"BOOTED\",{\"count\":32,\"heap_used\":950,\"heap_length\":1519,\"heap_increment\":569,\"heap_live_slot\":385225,\"heap_free_slot\":2014,\"heap_final_slot\":0,\"heap_swept_slot\":101119,\"heap_eden_page_length\":950,\"heap_tomb_page_length\":0,\"total_allocated_object\":2184137,\"total_freed_object\":1798912,\"malloc_increase\":9665288,\"malloc_limit\":16777216,\"minor_gc_count\":26,\"major_gc_count\":6,\"remembered_shady_object\":5145,\"remembered_shady_object_limit\":6032,\"old_object\":230164,\"old_object_limit\":301030,\"oldmalloc_increase\":11715304,\"oldmalloc_limit\":24159190},{\"major_by\":null,\"gc_by\":\"newobj\",\"have_finalizer\":false,\"immediate_sweep\":false},null]]",
50
- :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'TuneMyGC 1.0'}).
50
+ :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>"TuneMyGC #{TuneMyGc::VERSION}"}).
51
51
  to_return(:status => 501, :body => "", :headers => {})
52
52
 
53
53
  out, err = capture_io do
@@ -66,7 +66,7 @@ class TestSyncer < TuneMyGcTestCase
66
66
  snapshots.take_raw(Fixtures::STAGE_BOOTED)
67
67
  stub_request(:post, "https://tunemygc.com/ruby").
68
68
  with(:body => "[#{ActiveSupport::JSON.encode(TuneMyGc::Syncer::ENVIRONMENT)},[1420152606.1162581,\"BOOTED\",{\"count\":32,\"heap_used\":950,\"heap_length\":1519,\"heap_increment\":569,\"heap_live_slot\":385225,\"heap_free_slot\":2014,\"heap_final_slot\":0,\"heap_swept_slot\":101119,\"heap_eden_page_length\":950,\"heap_tomb_page_length\":0,\"total_allocated_object\":2184137,\"total_freed_object\":1798912,\"malloc_increase\":9665288,\"malloc_limit\":16777216,\"minor_gc_count\":26,\"major_gc_count\":6,\"remembered_shady_object\":5145,\"remembered_shady_object_limit\":6032,\"old_object\":230164,\"old_object_limit\":301030,\"oldmalloc_increase\":11715304,\"oldmalloc_limit\":24159190},{\"major_by\":null,\"gc_by\":\"newobj\",\"have_finalizer\":false,\"immediate_sweep\":false},null]]",
69
- :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'TuneMyGC 1.0'}).
69
+ :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>"TuneMyGC #{TuneMyGc::VERSION}"}).
70
70
  to_return(:status => 412, :body => "", :headers => {})
71
71
 
72
72
  out, err = capture_io do
@@ -83,7 +83,7 @@ class TestSyncer < TuneMyGcTestCase
83
83
  snapshots.take_raw(Fixtures::STAGE_BOOTED)
84
84
  stub_request(:post, "https://tunemygc.com/ruby").
85
85
  with(:body => "[#{ActiveSupport::JSON.encode(TuneMyGc::Syncer::ENVIRONMENT)},[1420152606.1162581,\"BOOTED\",{\"count\":32,\"heap_used\":950,\"heap_length\":1519,\"heap_increment\":569,\"heap_live_slot\":385225,\"heap_free_slot\":2014,\"heap_final_slot\":0,\"heap_swept_slot\":101119,\"heap_eden_page_length\":950,\"heap_tomb_page_length\":0,\"total_allocated_object\":2184137,\"total_freed_object\":1798912,\"malloc_increase\":9665288,\"malloc_limit\":16777216,\"minor_gc_count\":26,\"major_gc_count\":6,\"remembered_shady_object\":5145,\"remembered_shady_object_limit\":6032,\"old_object\":230164,\"old_object_limit\":301030,\"oldmalloc_increase\":11715304,\"oldmalloc_limit\":24159190},{\"major_by\":null,\"gc_by\":\"newobj\",\"have_finalizer\":false,\"immediate_sweep\":false},null]]",
86
- :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'TuneMyGC 1.0'}).
86
+ :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>"TuneMyGC #{TuneMyGc::VERSION}"}).
87
87
  to_return(:status => 400, :body => "snapshot timestamp", :headers => {})
88
88
 
89
89
  out, err = capture_io do
@@ -101,7 +101,7 @@ class TestSyncer < TuneMyGcTestCase
101
101
  snapshots.take_raw(Fixtures::STAGE_BOOTED)
102
102
  stub_request(:post, "https://tunemygc.com/ruby").
103
103
  with(:body => "[#{ActiveSupport::JSON.encode(TuneMyGc::Syncer::ENVIRONMENT)},[1420152606.1162581,\"BOOTED\",{\"count\":32,\"heap_used\":950,\"heap_length\":1519,\"heap_increment\":569,\"heap_live_slot\":385225,\"heap_free_slot\":2014,\"heap_final_slot\":0,\"heap_swept_slot\":101119,\"heap_eden_page_length\":950,\"heap_tomb_page_length\":0,\"total_allocated_object\":2184137,\"total_freed_object\":1798912,\"malloc_increase\":9665288,\"malloc_limit\":16777216,\"minor_gc_count\":26,\"major_gc_count\":6,\"remembered_shady_object\":5145,\"remembered_shady_object_limit\":6032,\"old_object\":230164,\"old_object_limit\":301030,\"oldmalloc_increase\":11715304,\"oldmalloc_limit\":24159190},{\"major_by\":null,\"gc_by\":\"newobj\",\"have_finalizer\":false,\"immediate_sweep\":false},null]]",
104
- :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'TuneMyGC 1.0'}).
104
+ :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>"TuneMyGC #{TuneMyGc::VERSION}"}).
105
105
  to_return(:status => 404, :body => "", :headers => {})
106
106
 
107
107
  out, err = capture_io do
@@ -117,7 +117,7 @@ class TestSyncer < TuneMyGcTestCase
117
117
  snapshots.take_raw(Fixtures::STAGE_BOOTED)
118
118
  stub_request(:post, "https://tunemygc.com/ruby").
119
119
  with(:body => "[#{ActiveSupport::JSON.encode(TuneMyGc::Syncer::ENVIRONMENT)},[1420152606.1162581,\"BOOTED\",{\"count\":32,\"heap_used\":950,\"heap_length\":1519,\"heap_increment\":569,\"heap_live_slot\":385225,\"heap_free_slot\":2014,\"heap_final_slot\":0,\"heap_swept_slot\":101119,\"heap_eden_page_length\":950,\"heap_tomb_page_length\":0,\"total_allocated_object\":2184137,\"total_freed_object\":1798912,\"malloc_increase\":9665288,\"malloc_limit\":16777216,\"minor_gc_count\":26,\"major_gc_count\":6,\"remembered_shady_object\":5145,\"remembered_shady_object_limit\":6032,\"old_object\":230164,\"old_object_limit\":301030,\"oldmalloc_increase\":11715304,\"oldmalloc_limit\":24159190},{\"major_by\":null,\"gc_by\":\"newobj\",\"have_finalizer\":false,\"immediate_sweep\":false},null]]",
120
- :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'TuneMyGC 1.0'}).
120
+ :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>"TuneMyGC #{TuneMyGc::VERSION}"}).
121
121
  to_return(:status => 426, :body => "2", :headers => {})
122
122
 
123
123
  out, err = capture_io do
@@ -134,7 +134,7 @@ class TestSyncer < TuneMyGcTestCase
134
134
  snapshots.take_raw(Fixtures::STAGE_BOOTED)
135
135
  stub_request(:post, "https://tunemygc.com/ruby").
136
136
  with(:body => "[#{ActiveSupport::JSON.encode(TuneMyGc::Syncer::ENVIRONMENT)},[1420152606.1162581,\"BOOTED\",{\"count\":32,\"heap_used\":950,\"heap_length\":1519,\"heap_increment\":569,\"heap_live_slot\":385225,\"heap_free_slot\":2014,\"heap_final_slot\":0,\"heap_swept_slot\":101119,\"heap_eden_page_length\":950,\"heap_tomb_page_length\":0,\"total_allocated_object\":2184137,\"total_freed_object\":1798912,\"malloc_increase\":9665288,\"malloc_limit\":16777216,\"minor_gc_count\":26,\"major_gc_count\":6,\"remembered_shady_object\":5145,\"remembered_shady_object_limit\":6032,\"old_object\":230164,\"old_object_limit\":301030,\"oldmalloc_increase\":11715304,\"oldmalloc_limit\":24159190},{\"major_by\":null,\"gc_by\":\"newobj\",\"have_finalizer\":false,\"immediate_sweep\":false},null]]",
137
- :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'TuneMyGC 1.0'}).to_raise(IOError.new("dang"))
137
+ :headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>"TuneMyGC #{TuneMyGc::VERSION}"}).to_raise(IOError.new("dang"))
138
138
 
139
139
  out, err = capture_io do
140
140
  TuneMyGc.logger = Logger.new($stdout)
data/tunemygc.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.version = TuneMyGc::VERSION
10
10
  s.summary = "TuneMyGC - optimal MRI Ruby 2.1+ Garbage Collection"
11
11
  s.description = "Agent for the GC tuning webservice https://www.tunemygc.com - optimal settings for throughput and memory usage of Rails applications"
12
- s.authors = ["Bear Metal"]
12
+ s.authors = ["Bear Metal"]
13
13
  s.email = ["info@bearmetal.eu"]
14
14
  s.license = "MIT"
15
15
  s.homepage = "https://tunemygc.com"
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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - Bear Metal
7
+ - Bear Metal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-28 00:00:00.000000000 Z
11
+ date: 2015-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport