scout_apm 4.1.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +4 -0
- data/.travis.yml +3 -0
- data/CHANGELOG.markdown +4 -0
- data/gems/typhoeus.gemfile +3 -0
- data/lib/scout_apm/instruments/typhoeus.rb +1 -1
- data/lib/scout_apm/version.rb +1 -1
- data/test/unit/instruments/typhoeus_test.rb +42 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b7247aa1c6545f1bad63c0f911359ba038686c9cf15b30d560ca887467956ef
|
4
|
+
data.tar.gz: 1fd60f4f23521c1274d27cbf710886bbb5af1baa922ddb3642254917c4db9061
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1581588299fe697107ce3fd8be5575bd63dbc811cf1b6827e08e666ff7e24a9f857366592e632a441e53daea21914c9a9ec7dfdc8acaa1cfaabccde9636b3b56
|
7
|
+
data.tar.gz: 41c2b41c8e7875188f671b59ad23aa62974b2e0c2ae3d08e93366e81158809b14b8b4c8f217c198e39d311ec8ef1921ec672da726a095702c1b7d7521ab0f7f3
|
data/.github/workflows/test.yml
CHANGED
@@ -26,6 +26,9 @@ jobs:
|
|
26
26
|
- ruby: 2.4
|
27
27
|
- ruby: 2.5
|
28
28
|
- ruby: 2.6
|
29
|
+
- ruby: 2.6
|
30
|
+
gemfile: gems/typhoeus.gemfile
|
31
|
+
test_features: "typhoeus"
|
29
32
|
- ruby: 2.6
|
30
33
|
gemfile: gems/octoshark.gemfile
|
31
34
|
- ruby: 2.6
|
@@ -36,6 +39,7 @@ jobs:
|
|
36
39
|
|
37
40
|
env:
|
38
41
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
42
|
+
SCOUT_TEST_FEATURES: ${{ matrix.test_features }}
|
39
43
|
|
40
44
|
runs-on: ubuntu-latest
|
41
45
|
|
data/.travis.yml
CHANGED
data/CHANGELOG.markdown
CHANGED
@@ -30,7 +30,7 @@ module ScoutApm
|
|
30
30
|
module TyphoeusHydraInstrumentation
|
31
31
|
def run(*args, &block)
|
32
32
|
layer = ScoutApm::Layer.new("HTTP", "Hydra")
|
33
|
-
layer.desc = scout_desc
|
33
|
+
layer.desc = scout_desc
|
34
34
|
|
35
35
|
req = ScoutApm::RequestManager.lookup
|
36
36
|
req.start_layer(layer)
|
data/lib/scout_apm/version.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
if (ENV["SCOUT_TEST_FEATURES"] || "").include?("typhoeus")
|
2
|
+
require 'test_helper'
|
3
|
+
|
4
|
+
require 'scout_apm/instruments/typhoeus'
|
5
|
+
|
6
|
+
require 'typhoeus'
|
7
|
+
|
8
|
+
class TyphoeusTest < Minitest::Test
|
9
|
+
def setup
|
10
|
+
@context = ScoutApm::AgentContext.new
|
11
|
+
@recorder = FakeRecorder.new
|
12
|
+
ScoutApm::Agent.instance.context.recorder = @recorder
|
13
|
+
ScoutApm::Instruments::Typhoeus.new(@context).install
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_instruments_typhoeus_hydra
|
17
|
+
hydra = Typhoeus::Hydra.new
|
18
|
+
2.times.map{ hydra.queue(Typhoeus::Request.new("example.com", followlocation: true)) }
|
19
|
+
|
20
|
+
assert_equal "2 requests", hydra.scout_desc
|
21
|
+
|
22
|
+
hydra.run
|
23
|
+
assert_equal "0 requests", hydra.scout_desc
|
24
|
+
assert_recorded(@recorder, "HTTP", "Hydra", "2 requests")
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_instruments_typhoeus
|
28
|
+
Typhoeus.get("example.com", followlocation: true)
|
29
|
+
assert_recorded(@recorder, "HTTP", "get", "example.com")
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def assert_recorded(recorder, type, name, desc = nil)
|
35
|
+
req = recorder.requests.first
|
36
|
+
assert req, "recorder recorded no layers"
|
37
|
+
assert_equal type, req.root_layer.type
|
38
|
+
assert_equal name, req.root_layer.name
|
39
|
+
assert_equal desc, req.root_layer.desc if !desc.nil?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
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: 4.1.
|
4
|
+
version: 4.1.1
|
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: 2021-06-
|
12
|
+
date: 2021-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -238,6 +238,7 @@ files:
|
|
238
238
|
- gems/rails4.gemfile
|
239
239
|
- gems/rails5.gemfile
|
240
240
|
- gems/rails6.gemfile
|
241
|
+
- gems/typhoeus.gemfile
|
241
242
|
- lib/scout_apm.rb
|
242
243
|
- lib/scout_apm/agent.rb
|
243
244
|
- lib/scout_apm/agent/exit_handler.rb
|
@@ -435,6 +436,7 @@ files:
|
|
435
436
|
- test/unit/instruments/active_record_test.rb
|
436
437
|
- test/unit/instruments/net_http_test.rb
|
437
438
|
- test/unit/instruments/percentile_sampler_test.rb
|
439
|
+
- test/unit/instruments/typhoeus_test.rb
|
438
440
|
- test/unit/layaway_test.rb
|
439
441
|
- test/unit/layer_children_set_test.rb
|
440
442
|
- test/unit/layer_converters/depth_first_walker_test.rb
|