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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5af3fd0ff7d9f43aa8ec1b205104fb90784ba83b98250ef871d5bd1282734432
4
- data.tar.gz: aae89c06e87f165d0ee87491fbb58253b7b38cdad29375e555e9e0c1d5607129
3
+ metadata.gz: 8b7247aa1c6545f1bad63c0f911359ba038686c9cf15b30d560ca887467956ef
4
+ data.tar.gz: 1fd60f4f23521c1274d27cbf710886bbb5af1baa922ddb3642254917c4db9061
5
5
  SHA512:
6
- metadata.gz: 304283c6c853ce0b2421eccaf3e331c784bd97bda96014777a3a52b64212250595c8d6f7ff390ee154a090d096d1b37f93f221a5e22b2133e47b4a4e36dc4d8e
7
- data.tar.gz: 453dd2e29eb7d8bc44ef3527a7ab8ba486d5c9c709b9be275a0223df96deb1d7628c97418a220ca0425e5c6706e1e60c1a8f750f544b223a3b3fcd6c4e924d4f
6
+ metadata.gz: 1581588299fe697107ce3fd8be5575bd63dbc811cf1b6827e08e666ff7e24a9f857366592e632a441e53daea21914c9a9ec7dfdc8acaa1cfaabccde9636b3b56
7
+ data.tar.gz: 41c2b41c8e7875188f671b59ad23aa62974b2e0c2ae3d08e93366e81158809b14b8b4c8f217c198e39d311ec8ef1921ec672da726a095702c1b7d7521ab0f7f3
@@ -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
@@ -13,6 +13,9 @@ matrix:
13
13
  - rvm: 2.6
14
14
  - rvm: 2.7
15
15
  - rvm: 3.0
16
+ - rvm: 2.6
17
+ gemfile: gems/typhoeus.gemfile
18
+ env: "SCOUT_TEST_FEATURES=typhoeus"
16
19
  - rvm: 2.6
17
20
  gemfile: gems/octoshark.gemfile
18
21
  - rvm: 2.6
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 4.1.1
2
+
3
+ * Fix issue with Typheous Hydra instrument (#418)
4
+
1
5
  # 4.1.0
2
6
 
3
7
  * Preload Celluloid in Shoryuken instrumentation (#331)
@@ -0,0 +1,3 @@
1
+ eval_gemfile("../Gemfile")
2
+
3
+ gem 'typhoeus'
@@ -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 if current_layer
33
+ layer.desc = scout_desc
34
34
 
35
35
  req = ScoutApm::RequestManager.lookup
36
36
  req.start_layer(layer)
@@ -1,3 +1,3 @@
1
1
  module ScoutApm
2
- VERSION = "4.1.0"
2
+ VERSION = "4.1.1"
3
3
  end
@@ -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.0
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-03 00:00:00.000000000 Z
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