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 +4 -4
- data/CHANGELOG.markdown +4 -0
- data/lib/scout_apm/agent.rb +7 -14
- data/lib/scout_apm/background_job_integrations/delayed_job.rb +1 -1
- data/lib/scout_apm/version.rb +1 -1
- data/lib/scout_apm.rb +0 -1
- metadata +4 -4
- data/lib/scout_apm/instruments/delayed_job.rb +0 -57
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 270c8e00f124e50fa52444a01e1d17339ea46a86
|
4
|
+
data.tar.gz: e9699a8a5614f9e752a0b64fba22079a655e52d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e1935a1bdb172835103fc0b6a61ecf3e3306df472db5a87730c4d056cc20ad8fa36abde59b59bdf577e463645e57c358e6a12e3e719ca870811ed90d6bbe0ea
|
7
|
+
data.tar.gz: e53d0af91f2de2f6123ade8b76744cdbf8b33bc10d13913aa930782a75b576b0db4b5a91b92bfe93b50dd15be4d90d8dce64fd6d9a56828eb29543544504a467
|
data/CHANGELOG.markdown
CHANGED
data/lib/scout_apm/agent.rb
CHANGED
@@ -275,20 +275,13 @@ module ScoutApm
|
|
275
275
|
|
276
276
|
# Loads the instrumention logic.
|
277
277
|
def load_instruments
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
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)
|
data/lib/scout_apm/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|