scout_apm 1.2.0 → 1.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c86bce406e281536552a03ab7553cb2f79c40ec7
4
- data.tar.gz: a5f327840d2e0325e4b2f284e522ad06ad04c887
3
+ metadata.gz: 951fb125e1266317ef5b4e0ec486ec3b946be418
4
+ data.tar.gz: 689544330b9f6a8f1b9f648257dc6eee972432b5
5
5
  SHA512:
6
- metadata.gz: c0dd0f82b57ef44d53fcb69221c8306caf8f7850541ec160edea79ab6ff3d71434d93b7fec897dae9c7d9f8f337259988631a6642c1168d0ae3d0df82de480fb
7
- data.tar.gz: e0a60cb519c43dbf4acadea60873280ffb05f3ec836d55ecdb54863796a166f0b689083f4b7a6a01f5b0d387a98c0bc624e82178098655f70f9bbb9cd51e1c76
6
+ metadata.gz: b99fc25a5c4af86e600a3f9b1a2a8cb53505e58d1b84468c075fc54a36ad361b36d3f0a4ca717339dfb30aeca344126487783771cd55ef397c79e28bc4a2a076
7
+ data.tar.gz: d63b8be55f12a1435f1c4f74edad4062cc6d47b3e1e314f0e0cd91a0afa2d0947dbc8a7bae84258cf6df52c5392d65a8a4bf0d5ed50513ebac33a4561cc3eb71
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.2.1
2
+
3
+ * Fix a small issue where the middleware that attempts to start the agent could
4
+ mistakenly detect that the agent was running when in fact it wasn't.
5
+
1
6
  # 1.2.0
2
7
 
3
8
  * Middleware tracing - Track time in the Rack middleware that Rails sets up
@@ -90,7 +90,6 @@ module ScoutApm
90
90
 
91
91
  return false unless preconditions_met?(options)
92
92
 
93
-
94
93
  @started = true
95
94
 
96
95
  logger.info "Starting monitoring for [#{environment.application_name}]. Framework [#{environment.framework}] App Server [#{environment.app_server}] Background Job Framework [#{environment.background_job_name}]."
@@ -176,9 +175,14 @@ module ScoutApm
176
175
  return !environment.forking?
177
176
  end
178
177
 
178
+ def background_worker_running?
179
+ !! @background_worker_thread
180
+ end
181
+
179
182
  # Creates the worker thread. The worker thread is a loop that runs continuously. It sleeps for +Agent#period+ and when it wakes,
180
183
  # processes data, either saving it to disk or reporting to Scout.
181
184
  def start_background_worker
185
+ logger.info "Not starting background worker, already started" and return if background_worker_running?
182
186
  logger.info "Initializing worker thread."
183
187
  @background_worker = ScoutApm::BackgroundWorker.new
184
188
  @background_worker_thread = Thread.new do
@@ -5,7 +5,7 @@ module ScoutApm
5
5
  def initialize(app)
6
6
  @app = app
7
7
  @attempts = 0
8
- @started = ScoutApm::Agent.instance.started?
8
+ @started = ScoutApm::Agent.instance.started? && ScoutApm::Agent.instance.background_worker_running?
9
9
  end
10
10
 
11
11
  # If we get a web request in, then we know we're running in some sort of app server
@@ -21,7 +21,8 @@ module ScoutApm
21
21
  def attempt_to_start_agent
22
22
  @attempts += 1
23
23
  ScoutApm::Agent.instance.start(:skip_app_server_check => true)
24
- @started = ScoutApm::Agent.instance.started?
24
+ ScoutApm::Agent.instance.start_background_worker
25
+ @started = ScoutApm::Agent.instance.started? && ScoutApm::Agent.instance.background_worker_running?
25
26
  rescue => e
26
27
  # Can't be sure of any logging here, so fall back to ENV var and STDOUT
27
28
  if ENV["SCOUT_LOG_LEVEL"] == "debug"
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
4
4
 
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.2.0
4
+ version: 1.2.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: 2015-12-22 00:00:00.000000000 Z
12
+ date: 2015-12-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest