tunemygc 1.0.40 → 1.0.41

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c07dd62ca20e8ee9410d4fd1ffca5d36e022b360
4
- data.tar.gz: 81636cecd88cf4bd83b382e908c58678ee6f8734
3
+ metadata.gz: 412b0a95adf194d9b20522a8e776cc765ea39be3
4
+ data.tar.gz: 40399148bd59d73763bbc0f5113022711fb44de1
5
5
  SHA512:
6
- metadata.gz: c62d3724196eb85e624d6ea30ccba0346109961fa717e15a7e2e3e0367f9a3698ea49a351f2abacd702bad9f72545e449e10ce6618a03265635e2c2450904686
7
- data.tar.gz: a6cb325fb5597701dcabe7f3876d5f160f7c91db6043fb93cbee87a83c2ed7054f63cc32c56c8043ea8df5612b7c869daf0c69389ebaa11c150f47fe8c5578db
6
+ metadata.gz: 6b117e8a87e5e4c35037d26edb02c8fce1ed82b679e02f54f194fc0ade12a00a1a47c297da8aac19dae1cc1d736ea15da0eecef547260c4985ff1db2ac1b7f24
7
+ data.tar.gz: ece06294a38927bd3c9538d3356e32b69ba171c08739fcf909fe7d4e48ea2e2f9d77f3b9347dba8ccfa96540887382ceaaf83a5b14490ace71992e7e32c0ac11
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tunemygc (1.0.38)
4
+ tunemygc (1.0.40)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -151,6 +151,48 @@ We're busy working on adding tips on the report URLs for some common problem con
151
151
 
152
152
  We have a [Heroku](http://www.heroku.com) addon in Alpha testing and the Ruby GC lends itself well to tuning through [12 factor](http://12factor.net) principles as it's designed around environment variables.
153
153
 
154
+ #### Custom hooks for add hoc scripts
155
+
156
+ Here's an example of instrumenting a custom worker script:
157
+
158
+ ``` ruby
159
+ # inject the agent and force the manual spy
160
+ ENV['RUBY_GC_SPY'] ||= 'manual'
161
+ require 'tunemygc'
162
+
163
+ require 'timeout'
164
+ require 'queue_classic'
165
+
166
+ FailedQueue = QC::Queue.new("failed_jobs")
167
+
168
+ class MyWorker < QC::Worker
169
+ def handle_failure(job, e)
170
+ FailedQueue.enqueue(job[:method], *job[:args])
171
+ end
172
+ end
173
+
174
+ worker = MyWorker.new
175
+
176
+ trap('INT') { exit }
177
+ trap('TERM') { worker.stop }
178
+
179
+ # Signal we're ready to start doing work
180
+ TuneMyGc.booted
181
+
182
+ loop do
183
+ job = worker.lock_job
184
+ Timeout::timeout(5) do
185
+ # signal the start of a unit of work
186
+ TuneMyGc.processing_started
187
+ worker.process(job)
188
+ # signal the end of a unit of work
189
+ TuneMyGc.processing_ended
190
+ end
191
+ end
192
+
193
+ # When the process exits, results are synced with the TuneMyGC service
194
+ ```
195
+
154
196
  ## Security and privacy concerns
155
197
 
156
198
  We don't track any data specific to your application other than a simple environment header which allows us to pick the best tuner for your setup:
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module TuneMyGc
4
- VERSION = "1.0.40"
4
+ VERSION = "1.0.41"
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.40
4
+ version: 1.0.41
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-13 00:00:00.000000000 Z
11
+ date: 2015-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport