scout_apm 1.4.1 → 1.4.2
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.rb +1 -0
- data/lib/scout_apm/agent.rb +1 -0
- data/lib/scout_apm/instruments/http_client.rb +41 -0
- data/lib/scout_apm/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dfbd237d7807fb1bb725e664bb1f13a985bdca1
|
4
|
+
data.tar.gz: bbff3e6d54f08e072b93789f3d3430ca10fe601b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f794b60fc223dc0ad1077b60d33de95675d1e6fcc4bf2126a66a49889815d9b35f2d92f854f2863ad7c59b9938b93e5491ec1e1c4812c4a76eb997e20ff7d83d
|
7
|
+
data.tar.gz: 2758c61a4b2e6eb6bcc8c0fffe8809de7286716d02a42ebc3bbf629fbef15fad88179058ce519f9e4402f712c2c76adc73a8cc5b1851ef7d62680f4be37875bb
|
data/CHANGELOG.markdown
CHANGED
data/lib/scout_apm.rb
CHANGED
@@ -59,6 +59,7 @@ require 'scout_apm/deploy_integrations/capistrano_3'
|
|
59
59
|
#require 'scout_apm/deploy_integrations/capistrano_2'
|
60
60
|
|
61
61
|
require 'scout_apm/instruments/net_http'
|
62
|
+
require 'scout_apm/instruments/http_client'
|
62
63
|
require 'scout_apm/instruments/moped'
|
63
64
|
require 'scout_apm/instruments/mongoid'
|
64
65
|
require 'scout_apm/instruments/delayed_job'
|
data/lib/scout_apm/agent.rb
CHANGED
@@ -252,6 +252,7 @@ module ScoutApm
|
|
252
252
|
install_instrument(ScoutApm::Instruments::Moped)
|
253
253
|
install_instrument(ScoutApm::Instruments::Mongoid)
|
254
254
|
install_instrument(ScoutApm::Instruments::NetHttp)
|
255
|
+
install_instrument(ScoutApm::Instruments::HttpClient)
|
255
256
|
|
256
257
|
if StackProf.respond_to?(:fake?) && StackProf.fake?
|
257
258
|
logger.info 'StackProf not found - add `gem "stackprof"` to your Gemfile to enable advanced code profiling (only for Ruby 2.1+)'
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module ScoutApm
|
2
|
+
module Instruments
|
3
|
+
class HttpClient
|
4
|
+
attr_reader :logger
|
5
|
+
|
6
|
+
def initalize(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
|
+
|
18
|
+
if defined?(::HTTPClient)
|
19
|
+
ScoutApm::Agent.instance.logger.info "Instrumenting HTTPClient"
|
20
|
+
|
21
|
+
::HTTPClient.class_eval do
|
22
|
+
include ScoutApm::Tracer
|
23
|
+
|
24
|
+
def request_with_scout_instruments(*args, &block)
|
25
|
+
method = args[0].to_s
|
26
|
+
url = args[1]
|
27
|
+
url = url && url[0..99]
|
28
|
+
|
29
|
+
self.class.instrument("HTTP", method, :desc => url) do
|
30
|
+
request_without_scout_instruments(*args, &block)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
alias request_without_scout_instruments request
|
35
|
+
alias request request_with_scout_instruments
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
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: 1.4.
|
4
|
+
version: 1.4.2
|
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-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- lib/scout_apm/instruments/action_controller_rails_3_rails4.rb
|
93
93
|
- lib/scout_apm/instruments/active_record.rb
|
94
94
|
- lib/scout_apm/instruments/delayed_job.rb
|
95
|
+
- lib/scout_apm/instruments/http_client.rb
|
95
96
|
- lib/scout_apm/instruments/middleware_detailed.rb
|
96
97
|
- lib/scout_apm/instruments/middleware_summary.rb
|
97
98
|
- lib/scout_apm/instruments/mongoid.rb
|