scout_apm 3.0.0.pre17 → 3.0.0.pre18

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
  SHA1:
3
- metadata.gz: 2ca61b61ba4135b8ee89ffb1efb4946f0c0afa44
4
- data.tar.gz: d980d2baab58e6ceecf1d54aa97128180cf9052e
3
+ metadata.gz: cbd90a42f996c3061f49d47dab8030bd68da59bd
4
+ data.tar.gz: 05dd5875bc492ce4e8bcca1f590c20b0c39a7f03
5
5
  SHA512:
6
- metadata.gz: 5bd058b09d66c99c304af71ca7343462d02dc588230253712462fdad6628f718bad8a33655de42f1eb27ae98e2cec39840f247173e4fe0cf1ef0110dbb727105
7
- data.tar.gz: 2cd9079153c0d8f050055ae62e7d3c18531b6e90e6d5a4e12661c0cd5e598ab930584229304d2a44017347f00cb2fada6e407bfbc5b54a8ce871e3df91147f3d
6
+ metadata.gz: 62b89c1e2b9220e5e3e3f5ae008e2b858deaafce0b5119eff73ade0dd3b5c5f1447092057605819314dfef7fffd755b3e4a646b11ee5858e4ecaac090f6e2183
7
+ data.tar.gz: 9fc7f24849744a01258da4e8927e1bc0804d42b6dcb5d5b467a33042e7c89df245d8b67b75a2c03cb91d02a93a9b6566e6e3b1a5d2d006e90e77a5768209ff6f
@@ -2,6 +2,12 @@
2
2
 
3
3
  * ScoutProf BETA
4
4
 
5
+ # 2.4.4
6
+
7
+ * Prevent agent from starting when monitor=false
8
+ * Fix double-counting of HTTP requests when multiple http libraries are present
9
+ * Fix an issue with Resque instrumentation
10
+
5
11
  # 2.4.3
6
12
 
7
13
  * Ensure a startup hook runs on forking webservers
@@ -47,7 +47,8 @@ module ScoutApm
47
47
 
48
48
  context.installed!
49
49
 
50
- if ScoutApm::Agent::Preconditions.check?(context) || force
50
+ @preconditions = ScoutApm::Agent::Preconditions.new
51
+ if @preconditions.check?(context) || force
51
52
  start
52
53
  end
53
54
  end
@@ -55,8 +56,12 @@ module ScoutApm
55
56
  # Unconditionally starts the agent. This includes verifying instruments are
56
57
  # installed, and starting the background worker.
57
58
  #
58
- # Does not attempt to start twice.
59
- def start(_opts={})
59
+ # The monitor precondition is checked explicitly, and we will *never* start with monitor = false
60
+ #
61
+ # This does not attempt to start twice
62
+ def start(opts={})
63
+ return unless context.config.value('monitor')
64
+
60
65
  if context.started?
61
66
  start_background_worker unless background_worker_running?
62
67
  return
@@ -22,7 +22,12 @@ module ScoutApm
22
22
 
23
23
  PRECONDITION_DETECTED_SERVER = {
24
24
  :message => proc {|environ| "Deferring agent start. Standing by for first request" },
25
- :check => proc { |context| !app_server_missing?(context) && !background_job_missing?(context) },
25
+ :check => proc { |context|
26
+ app_server_missing = !context.environment.app_server_integration(true).found?
27
+ background_job_missing = context.environment.background_job_integrations.length == 0
28
+
29
+ !app_server_missing && !background_job_missing
30
+ },
26
31
  },
27
32
 
28
33
  PRECONDITION_ALREADY_STARTED = {
@@ -36,34 +41,29 @@ module ScoutApm
36
41
  },
37
42
  ]
38
43
 
39
- def self.check?(context)
40
- failed_preconditions = PRECONDITIONS.inject(Array.new) { |errors, condition|
41
- met = condition[:check].call(context)
42
- errors << condition[:message].call(context.environment) unless met
43
- errors
44
- }
44
+ def check?(context)
45
+ @check_result ||=
46
+ begin
47
+ failed_preconditions = PRECONDITIONS.inject(Array.new) { |errors, condition|
48
+ met = condition[:check].call(context)
49
+ errors << condition[:message].call(context.environment) unless met
50
+ errors
51
+ }
45
52
 
46
- if failed_preconditions.any?
47
- failed_preconditions.each {|msg| context.logger.warn(msg) }
48
- force? # if forced, return true anyway
49
- else
50
- # No errors, we met preconditions
51
- true
52
- end
53
+ if failed_preconditions.any?
54
+ failed_preconditions.each {|msg| context.logger.warn(msg) }
55
+ force? # if forced, return true anyway
56
+ else
57
+ # No errors, we met preconditions
58
+ true
59
+ end
60
+ end
53
61
  end
54
62
 
55
63
  # XXX: Wire up options here and below in the appserver & bg server detections
56
- def self.force?
64
+ def force?
57
65
  false
58
66
  end
59
-
60
- def self.app_server_missing?(context)
61
- !context.environment.app_server_integration(true).found? # && !options[:skip_app_server_check]
62
- end
63
-
64
- def self.background_job_missing?(context)
65
- context.environment.background_job_integrations.length == 0
66
- end
67
67
  end
68
68
  end
69
69
  end
@@ -52,8 +52,8 @@ module ScoutApm
52
52
  # expected to have its accepting webserver up and running
53
53
  def become_remote_client!(host, port)
54
54
  logger.debug("Becoming Remote Agent (reporting to: #{host}:#{port})")
55
- recorder = ScoutApm::Remote::Recorder.new(host, port, logger)
56
- store = ScoutApm::FakeStore.new
55
+ @recorder = ScoutApm::Remote::Recorder.new(host, port, logger)
56
+ @store = ScoutApm::FakeStore.new
57
57
  end
58
58
 
59
59
 
@@ -26,7 +26,7 @@ module ScoutApm
26
26
  include ScoutApm::Tracer
27
27
 
28
28
  def request_with_scout_instruments(*args,&block)
29
- self.class.instrument("HTTP", "request", :desc => request_scout_description(args.first)) do
29
+ self.class.instrument("HTTP", "request", :ignore_children => true, :desc => request_scout_description(args.first)) do
30
30
  request_without_scout_instruments(*args, &block)
31
31
  end
32
32
  end
@@ -41,7 +41,7 @@ module ScoutApm
41
41
 
42
42
  logger.debug("Remote: Server returned after #start call, thread exiting")
43
43
  rescue => e
44
- logger.debug("Remote: Server Exception, #{e}")
44
+ logger.debug("Remote: Server Exception, #{e},\n#{e.backtrace.join("\n\t")}")
45
45
  end
46
46
  end
47
47
  end
@@ -1,3 +1,3 @@
1
1
  module ScoutApm
2
- VERSION = "3.0.0.pre17"
2
+ VERSION = "3.0.0.pre18"
3
3
  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: 3.0.0.pre17
4
+ version: 3.0.0.pre18
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: 2018-01-18 00:00:00.000000000 Z
12
+ date: 2018-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -373,46 +373,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
373
373
  version: 1.3.1
374
374
  requirements: []
375
375
  rubyforge_project: scout_apm
376
- rubygems_version: 2.4.5.2
376
+ rubygems_version: 2.2.2
377
377
  signing_key:
378
378
  specification_version: 4
379
379
  summary: Ruby application performance monitoring
380
- test_files:
381
- - test/data/config_test_1.yml
382
- - test/test_helper.rb
383
- - test/unit/agent_test.rb
384
- - test/unit/background_job_integrations/sidekiq_test.rb
385
- - test/unit/config_test.rb
386
- - test/unit/context_test.rb
387
- - test/unit/db_query_metric_set_test.rb
388
- - test/unit/db_query_metric_stats_test.rb
389
- - test/unit/environment_test.rb
390
- - test/unit/fake_store_test.rb
391
- - test/unit/git_revision_test.rb
392
- - test/unit/histogram_test.rb
393
- - test/unit/ignored_uris_test.rb
394
- - test/unit/instruments/active_record_instruments_test.rb
395
- - test/unit/instruments/net_http_test.rb
396
- - test/unit/instruments/percentile_sampler_test.rb
397
- - test/unit/layaway_test.rb
398
- - test/unit/layer_children_set_test.rb
399
- - test/unit/layer_converters/depth_first_walker_test.rb
400
- - test/unit/layer_converters/metric_converter_test.rb
401
- - test/unit/layer_converters/stubs.rb
402
- - test/unit/limited_layer_test.rb
403
- - test/unit/logger_test.rb
404
- - test/unit/metric_set_test.rb
405
- - test/unit/remote/test_message.rb
406
- - test/unit/remote/test_router.rb
407
- - test/unit/remote/test_server.rb
408
- - test/unit/scored_item_set_test.rb
409
- - test/unit/serializers/payload_serializer_test.rb
410
- - test/unit/slow_job_policy_test.rb
411
- - test/unit/slow_request_policy_test.rb
412
- - test/unit/sql_sanitizer_test.rb
413
- - test/unit/store_test.rb
414
- - test/unit/test_tracked_request.rb
415
- - test/unit/utils/active_record_metric_name_test.rb
416
- - test/unit/utils/backtrace_parser_test.rb
417
- - test/unit/utils/numbers_test.rb
418
- - test/unit/utils/scm.rb
380
+ test_files: []