scout_apm 2.4.21 → 2.4.22
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 +4 -4
- data/.travis.yml +10 -2
- data/CHANGELOG.markdown +5 -0
- data/README.markdown +3 -3
- data/lib/scout_apm/agent_context.rb +1 -1
- data/lib/scout_apm/config.rb +1 -1
- data/lib/scout_apm/instruments/action_view.rb +101 -26
- data/lib/scout_apm/version.rb +1 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fa219a419aefb2e17c508ea1c337a2aeb336a21
|
4
|
+
data.tar.gz: bcedf91bcbac7ed3c111d0018af5f22123b54af3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1917e106d1ea9048bd9b68bfafbd3c24717db6827eee0510fc86d1e23da7f504df8dd2786b517420ac73e799ac38c83680635410de1100c901ecd3b8d895373a
|
7
|
+
data.tar.gz: 42ebd73a8e0048387ab628e9ae3e80186a7a548b0f75051b5f560bd529f893add7828f4747cb1fd9bb741a6d544a1fe1c8bcf27b61960d7dc4d4fdd3bf9ff7af
|
data/.travis.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
language: ruby
|
2
|
+
|
2
3
|
rvm:
|
3
4
|
- "1.8.7"
|
4
5
|
- "1.9.3"
|
@@ -6,10 +7,17 @@ rvm:
|
|
6
7
|
- "2.2"
|
7
8
|
- "2.4"
|
8
9
|
- "2.5"
|
10
|
+
|
9
11
|
cache: bundler
|
12
|
+
|
10
13
|
before_install:
|
11
|
-
|
12
|
-
- gem
|
14
|
+
# Don't gem update, since it tries to install RubyGems requiring 2.3+.
|
15
|
+
# - gem update --system
|
16
|
+
|
17
|
+
# Lock down the version. Newer versions only support Ruby 2.3+, but we need
|
18
|
+
# to test back further.
|
19
|
+
- gem install bundler -v '1.17.3'
|
20
|
+
|
13
21
|
jobs:
|
14
22
|
include:
|
15
23
|
- script: bundle exec rake test
|
data/CHANGELOG.markdown
CHANGED
data/README.markdown
CHANGED
@@ -12,8 +12,8 @@ The Scout agent is engineered to do some wonderful things:
|
|
12
12
|
|
13
13
|
* A unique focus on identifying those hard-to-investigate outliers like memory bloat, N+1s, and user-specific problems. [See an example workflow](http://scoutapp.com/newrelic-alternative).
|
14
14
|
* [Low-overhead](http://blog.scoutapp.com/articles/2016/02/07/overhead-benchmarks-new-relic-vs-scout)
|
15
|
-
* View your performance metrics during development with [DevTrace](
|
16
|
-
* Production-Safe profiling of custom code via [ScoutProf](
|
15
|
+
* View your performance metrics during development with [DevTrace](https://help.apm.scoutapp.com/#devtrace) and in production via [server_timing](https://github.com/scoutapp/ruby_server_timing).
|
16
|
+
* Production-Safe profiling of custom code via [ScoutProf](https://help.apm.scoutapp.com/#scoutprof) (BETA).
|
17
17
|
|
18
18
|
## Getting Started
|
19
19
|
|
@@ -64,7 +64,7 @@ SCOUT_DEV_TRACE=true rails server
|
|
64
64
|
## Docs
|
65
65
|
|
66
66
|
For the complete list of supported frameworks, Rubies, configuration options
|
67
|
-
and more, see our [help site](
|
67
|
+
and more, see our [help site](https://help.apm.scoutapp.com/).
|
68
68
|
|
69
69
|
## Help
|
70
70
|
|
@@ -205,7 +205,7 @@ module ScoutApm
|
|
205
205
|
if !@config.any_keys_found?
|
206
206
|
logger.info("No configuration file loaded, and no configuration found in ENV. " +
|
207
207
|
"For assistance configuring Scout, visit " +
|
208
|
-
"
|
208
|
+
"https://help.apm.scoutapp.com/#ruby-configuration-options")
|
209
209
|
end
|
210
210
|
end
|
211
211
|
end
|
data/lib/scout_apm/config.rb
CHANGED
@@ -6,7 +6,7 @@ require 'scout_apm/environment'
|
|
6
6
|
# Valid Config Options:
|
7
7
|
#
|
8
8
|
# This list is complete, but some are old and unused, or for developers of
|
9
|
-
# scout_apm itself. See the documentation at
|
9
|
+
# scout_apm itself. See the documentation at https://help.apm.scoutapp.com for
|
10
10
|
# customer-focused documentation.
|
11
11
|
#
|
12
12
|
# application_root - override the detected directory of the application
|
@@ -1,6 +1,13 @@
|
|
1
|
+
# Note, this instrument has the same logic in both Tracer and Module Prepend
|
2
|
+
# versions. If you update, be sure you update in both spots.
|
3
|
+
#
|
4
|
+
# The prepend version was added for Rails 6 support - ActiveRecord prepends on
|
5
|
+
# top of PartialRenderer#collection_with_template, which can (and does) cause
|
6
|
+
# infinite loops with our alias_method approach
|
1
7
|
module ScoutApm
|
2
8
|
module Instruments
|
3
|
-
#
|
9
|
+
# Instrumentation for Rails 3, 4, 5 is the same, using tracer.
|
10
|
+
# Rails 6 switches to using Module#prepend
|
4
11
|
class ActionView
|
5
12
|
attr_reader :context
|
6
13
|
|
@@ -18,36 +25,104 @@ module ScoutApm
|
|
18
25
|
end
|
19
26
|
|
20
27
|
def install
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
28
|
+
return unless defined?(::ActionView) && defined?(::ActionView::PartialRenderer)
|
29
|
+
|
30
|
+
if defined?(::Rails) && defined?(::Rails::VERSION) && defined?(::Rails::VERSION::MAJOR) && ::Rails::VERSION::MAJOR < 6
|
31
|
+
install_using_tracer
|
32
|
+
else
|
33
|
+
install_using_prepend
|
34
|
+
end
|
35
|
+
@installed = true
|
36
|
+
end
|
37
|
+
|
38
|
+
def install_using_tracer
|
39
|
+
logger.info "Instrumenting ActionView::PartialRenderer"
|
40
|
+
::ActionView::PartialRenderer.class_eval do
|
41
|
+
include ScoutApm::Tracer
|
42
|
+
|
43
|
+
instrument_method :render_partial,
|
44
|
+
:type => "View",
|
45
|
+
:name => '#{@template.virtual_path rescue "Unknown Partial"}/Rendering',
|
46
|
+
:scope => true
|
47
|
+
|
48
|
+
instrument_method :collection_with_template,
|
49
|
+
:type => "View",
|
50
|
+
:name => '#{@template.virtual_path rescue "Unknown Collection"}/Rendering',
|
51
|
+
:scope => true
|
52
|
+
end
|
53
|
+
|
54
|
+
logger.info "Instrumenting ActionView::TemplateRenderer"
|
55
|
+
::ActionView::TemplateRenderer.class_eval do
|
56
|
+
include ScoutApm::Tracer
|
57
|
+
instrument_method :render_template,
|
58
|
+
:type => "View",
|
59
|
+
:name => '#{args[0].virtual_path rescue "Unknown"}/Rendering',
|
60
|
+
:scope => true
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def install_using_prepend
|
65
|
+
logger.info "Instrumenting ActionView::PartialRenderer"
|
66
|
+
::ActionView::PartialRenderer.prepend(ActionViewPartialRendererInstruments)
|
67
|
+
|
68
|
+
logger.info "Instrumenting ActionView::TemplateRenderer"
|
69
|
+
::ActionView::TemplateRenderer.prepend(ActionViewTemplateRendererInstruments)
|
70
|
+
end
|
71
|
+
|
72
|
+
module ActionViewPartialRendererInstruments
|
73
|
+
def render_partial(*args)
|
74
|
+
req = ScoutApm::RequestManager.lookup
|
75
|
+
|
76
|
+
template_name = @template.virtual_path rescue "Unknown Partial"
|
77
|
+
layer_name = template_name + "/Rendering"
|
78
|
+
|
79
|
+
layer = ScoutApm::Layer.new("View", layer_name)
|
80
|
+
layer.subscopable!
|
81
|
+
|
82
|
+
begin
|
83
|
+
req.start_layer(layer)
|
84
|
+
super(*args)
|
85
|
+
ensure
|
86
|
+
req.stop_layer
|
37
87
|
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def collection_with_template(*args)
|
91
|
+
req = ScoutApm::RequestManager.lookup
|
38
92
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
93
|
+
template_name = @template.virtual_path rescue "Unknown Collection"
|
94
|
+
layer_name = template_name + "/Rendering"
|
95
|
+
|
96
|
+
layer = ScoutApm::Layer.new("View", layer_name)
|
97
|
+
layer.subscopable!
|
98
|
+
|
99
|
+
begin
|
100
|
+
req.start_layer(layer)
|
101
|
+
super(*args)
|
102
|
+
ensure
|
103
|
+
req.stop_layer
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
module ActionViewTemplateRendererInstruments
|
109
|
+
def render_template(*args)
|
110
|
+
req = ScoutApm::RequestManager.lookup
|
111
|
+
|
112
|
+
template_name = args[0].virtual_path rescue "Unknown"
|
113
|
+
layer_name = template_name + "/Rendering"
|
114
|
+
|
115
|
+
layer = ScoutApm::Layer.new("View", layer_name)
|
116
|
+
layer.subscopable!
|
117
|
+
|
118
|
+
begin
|
119
|
+
req.start_layer(layer)
|
120
|
+
super(*args)
|
121
|
+
ensure
|
122
|
+
req.stop_layer
|
46
123
|
end
|
47
124
|
end
|
48
125
|
end
|
49
126
|
end
|
50
127
|
end
|
51
128
|
end
|
52
|
-
|
53
|
-
|
data/lib/scout_apm/version.rb
CHANGED
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.4.
|
4
|
+
version: 2.4.22
|
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:
|
12
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -392,7 +392,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
392
392
|
version: '0'
|
393
393
|
requirements: []
|
394
394
|
rubyforge_project: scout_apm
|
395
|
-
rubygems_version: 2.
|
395
|
+
rubygems_version: 2.6.14.3
|
396
396
|
signing_key:
|
397
397
|
specification_version: 4
|
398
398
|
summary: Ruby application performance monitoring
|