scout_apm 1.2.0.pre7 → 1.2.0.pre8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scout_apm/agent.rb +1 -0
- data/lib/scout_apm/instruments/rails_router.rb +36 -0
- data/lib/scout_apm/version.rb +1 -1
- data/lib/scout_apm.rb +2 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b5272cb3adff0eda6e90f8b9e25aedec12fc44a
|
4
|
+
data.tar.gz: a2548f87f76ab5d4d815fad9c4d4d768a247894d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34d61872e85d43f679c1cc50713fd73ed7d9f23ad01491d0d1202a14ece674773b5afb0357e1dc57baf72837699d9456df7fac74a9624de0ef12d51fc594a23a
|
7
|
+
data.tar.gz: ecc854b429e7ef8c920fc8209d7c71023426b4b85bacdd64debbcbe00cb9b460f99ae0321d0ca246fe563eb0044f98842538a74b2eb45c1b0ab024e7554e6c5a
|
data/lib/scout_apm/agent.rb
CHANGED
@@ -212,6 +212,7 @@ module ScoutApm
|
|
212
212
|
when :rails3_or_4 then
|
213
213
|
install_instrument(ScoutApm::Instruments::ActionControllerRails3)
|
214
214
|
install_instrument(ScoutApm::Instruments::Middleware)
|
215
|
+
install_instrument(ScoutApm::Instruments::RailsRouter)
|
215
216
|
when :sinatra then install_instrument(ScoutApm::Instruments::Sinatra)
|
216
217
|
end
|
217
218
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module ScoutApm
|
2
|
+
module Instruments
|
3
|
+
class RailsRouter
|
4
|
+
def initalize(logger=ScoutApm::Agent.instance.logger)
|
5
|
+
@logger = logger
|
6
|
+
@installed = false
|
7
|
+
end
|
8
|
+
|
9
|
+
def installed?
|
10
|
+
@installed
|
11
|
+
end
|
12
|
+
|
13
|
+
def install
|
14
|
+
@installed = true
|
15
|
+
|
16
|
+
if defined?(ActionDispatch) && defined?(ActionDispatch::Routing) && defined?(ActionDispatch::Routing::RouteSet)
|
17
|
+
ActionDispatch::Routing::RouteSet.class_eval do
|
18
|
+
def call_with_scout_instruments(*args)
|
19
|
+
req = ScoutApm::RequestManager.lookup
|
20
|
+
req.start_layer(ScoutApm::Layer.new("Router", "Rails"))
|
21
|
+
|
22
|
+
begin
|
23
|
+
call_without_scout_instruments(*args)
|
24
|
+
ensure
|
25
|
+
req.stop_layer
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
alias call_without_scout_instruments call
|
30
|
+
alias call call_with_scout_instruments
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/scout_apm/version.rb
CHANGED
data/lib/scout_apm.rb
CHANGED
@@ -66,6 +66,7 @@ require 'scout_apm/instruments/active_record'
|
|
66
66
|
require 'scout_apm/instruments/action_controller_rails_2'
|
67
67
|
require 'scout_apm/instruments/action_controller_rails_3'
|
68
68
|
require 'scout_apm/instruments/middleware'
|
69
|
+
require 'scout_apm/instruments/rails_router'
|
69
70
|
require 'scout_apm/instruments/sinatra'
|
70
71
|
require 'scout_apm/instruments/process/process_cpu'
|
71
72
|
require 'scout_apm/instruments/process/process_memory'
|
@@ -107,7 +108,7 @@ require 'scout_apm/serializers/deploy_serializer'
|
|
107
108
|
|
108
109
|
require 'scout_apm/middleware'
|
109
110
|
|
110
|
-
if defined?(Rails) && defined?(Rails::VERSION) && defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR >= 3
|
111
|
+
if defined?(Rails) && defined?(Rails::VERSION) && defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR >= 3 && defined?(Rails::Railtie)
|
111
112
|
module ScoutApm
|
112
113
|
class Railtie < Rails::Railtie
|
113
114
|
initializer "scout_apm.start" do |app|
|
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: 1.2.0.
|
4
|
+
version: 1.2.0.pre8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Haynes
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/scout_apm/instruments/net_http.rb
|
99
99
|
- lib/scout_apm/instruments/process/process_cpu.rb
|
100
100
|
- lib/scout_apm/instruments/process/process_memory.rb
|
101
|
+
- lib/scout_apm/instruments/rails_router.rb
|
101
102
|
- lib/scout_apm/instruments/sinatra.rb
|
102
103
|
- lib/scout_apm/layaway.rb
|
103
104
|
- lib/scout_apm/layaway_file.rb
|