scout_apm 2.1.12 → 2.1.13

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: 8d01f68861b6803d09d9780d51233cd1eb66db7c
4
- data.tar.gz: 8ef93aab69a31d695e98e56bb2b9c0f8ca8a4cd4
3
+ metadata.gz: 270c8e00f124e50fa52444a01e1d17339ea46a86
4
+ data.tar.gz: e9699a8a5614f9e752a0b64fba22079a655e52d1
5
5
  SHA512:
6
- metadata.gz: 77ed9e84c4fda4c8c4f7786ad854e23cf991ce24b71750e239ac61681f256fd02d2b9dfd0be496550dec3e7a9f901dec4a05e596d4d628e47d611d3378a3ffaa
7
- data.tar.gz: 717459f9e898f05a969713ae6840b182357e0701a5c37cb8cee835310b4eeeebf8f004add0f2addfab05cfe1a132b482ee8ae00c0e2212b5e3939622f5bd9910
6
+ metadata.gz: 5e1935a1bdb172835103fc0b6a61ecf3e3306df472db5a87730c4d056cc20ad8fa36abde59b59bdf577e463645e57c358e6a12e3e719ca870811ed90d6bbe0ea
7
+ data.tar.gz: e53d0af91f2de2f6123ade8b76744cdbf8b33bc10d13913aa930782a75b576b0db4b5a91b92bfe93b50dd15be4d90d8dce64fd6d9a56828eb29543544504a467
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.1.13
2
+
3
+ * Rework Delayed Job instrumentation to not interfere with other instruments.
4
+
1
5
  # 2.1.12
2
6
 
3
7
  * Revert 2.1.11's Delayed Job change - caused issues in a handful of environments
@@ -275,20 +275,13 @@ module ScoutApm
275
275
 
276
276
  # Loads the instrumention logic.
277
277
  def load_instruments
278
- if !background_job_missing?
279
- # case environment.background_job_name
280
- # when :delayed_job
281
- # install_instrument(ScoutApm::Instruments::DelayedJob)
282
- # end
283
- else
284
- case environment.framework
285
- when :rails then install_instrument(ScoutApm::Instruments::ActionControllerRails2)
286
- when :rails3_or_4 then
287
- install_instrument(ScoutApm::Instruments::ActionControllerRails3Rails4)
288
- install_instrument(ScoutApm::Instruments::MiddlewareSummary)
289
- install_instrument(ScoutApm::Instruments::RailsRouter)
290
- # when :sinatra then install_instrument(ScoutApm::Instruments::Sinatra)
291
- end
278
+ case environment.framework
279
+ when :rails then
280
+ install_instrument(ScoutApm::Instruments::ActionControllerRails2)
281
+ when :rails3_or_4 then
282
+ install_instrument(ScoutApm::Instruments::ActionControllerRails3Rails4)
283
+ install_instrument(ScoutApm::Instruments::MiddlewareSummary)
284
+ install_instrument(ScoutApm::Instruments::RailsRouter)
292
285
  end
293
286
 
294
287
  install_instrument(ScoutApm::Instruments::ActiveRecord)
@@ -8,7 +8,7 @@ module ScoutApm
8
8
  end
9
9
 
10
10
  def present?
11
- defined?(::Delayed::Job) && File.basename($PROGRAM_NAME).start_with?('delayed_job')
11
+ defined?(::Delayed::Job)
12
12
  end
13
13
 
14
14
  def forking?
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "2.1.12"
2
+ VERSION = "2.1.13"
3
3
  end
4
4
 
data/lib/scout_apm.rb CHANGED
@@ -69,7 +69,6 @@ require 'scout_apm/instruments/mongoid'
69
69
  require 'scout_apm/instruments/redis'
70
70
  require 'scout_apm/instruments/influxdb'
71
71
  require 'scout_apm/instruments/elasticsearch'
72
- require 'scout_apm/instruments/delayed_job'
73
72
  require 'scout_apm/instruments/active_record'
74
73
  require 'scout_apm/instruments/action_controller_rails_2'
75
74
  require 'scout_apm/instruments/action_controller_rails_3_rails4'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.12
4
+ version: 2.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-27 00:00:00.000000000 Z
12
+ date: 2016-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -147,7 +147,6 @@ files:
147
147
  - lib/scout_apm/instruments/action_controller_rails_2.rb
148
148
  - lib/scout_apm/instruments/action_controller_rails_3_rails4.rb
149
149
  - lib/scout_apm/instruments/active_record.rb
150
- - lib/scout_apm/instruments/delayed_job.rb
151
150
  - lib/scout_apm/instruments/elasticsearch.rb
152
151
  - lib/scout_apm/instruments/grape.rb
153
152
  - lib/scout_apm/instruments/http_client.rb
@@ -268,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
267
  version: '0'
269
268
  requirements: []
270
269
  rubyforge_project: scout_apm
271
- rubygems_version: 2.4.8
270
+ rubygems_version: 2.6.2
272
271
  signing_key:
273
272
  specification_version: 4
274
273
  summary: Ruby application performance monitoring
@@ -296,3 +295,4 @@ test_files:
296
295
  - test/unit/utils/active_record_metric_name_test.rb
297
296
  - test/unit/utils/backtrace_parser_test.rb
298
297
  - test/unit/utils/numbers_test.rb
298
+ has_rdoc:
@@ -1,57 +0,0 @@
1
- module ScoutApm
2
- module Instruments
3
- class DelayedJob
4
- attr_reader :logger
5
-
6
- def initialize(logger=ScoutApm::Agent.instance.logger)
7
- @logger = logger
8
- @installed = false
9
- end
10
-
11
- def installed?
12
- @installed
13
- end
14
-
15
- def install
16
- @installed = true
17
- if defined?(::Delayed::Worker)
18
- ::Delayed::Worker.class_eval do
19
- include ScoutApm::Tracer
20
- include ScoutApm::Instruments::DelayedJobInstruments
21
- alias run_without_scout_instruments run
22
- alias run run_with_scout_instruments
23
- end
24
- end
25
- end
26
- end
27
-
28
- module DelayedJobInstruments
29
- def run_with_scout_instruments(job)
30
- scout_method_name = method_from_handler(job.handler)
31
- queue = job.queue
32
- latency = (Time.now.to_f - job.created_at.to_f) * 1000
33
-
34
- ScoutApm::Agent.instance.store.track_one!("Queue", queue, 0, {:extra_metrics => {:latency => latency}})
35
- req = ScoutApm::RequestManager.lookup
36
- req.job!
37
- req.start_layer( ScoutApm::Layer.new("Job", scout_method_name) )
38
-
39
- begin
40
- run_without_scout_instruments(job)
41
- rescue
42
- req.error!
43
- raise
44
- ensure
45
- req.stop_layer
46
- end
47
- end
48
-
49
- def method_from_handler(handler)
50
- job_handler = YAML.load(handler)
51
- klass = job_handler.object.name
52
- method = job_handler.method_name
53
- "#{klass}##{method}"
54
- end
55
- end
56
- end
57
- end