scout_apm 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +5 -0
- data/lib/scout_apm/agent.rb +5 -1
- data/lib/scout_apm/middleware.rb +3 -2
- data/lib/scout_apm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 951fb125e1266317ef5b4e0ec486ec3b946be418
|
4
|
+
data.tar.gz: 689544330b9f6a8f1b9f648257dc6eee972432b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b99fc25a5c4af86e600a3f9b1a2a8cb53505e58d1b84468c075fc54a36ad361b36d3f0a4ca717339dfb30aeca344126487783771cd55ef397c79e28bc4a2a076
|
7
|
+
data.tar.gz: d63b8be55f12a1435f1c4f74edad4062cc6d47b3e1e314f0e0cd91a0afa2d0947dbc8a7bae84258cf6df52c5392d65a8a4bf0d5ed50513ebac33a4561cc3eb71
|
data/CHANGELOG.markdown
CHANGED
data/lib/scout_apm/agent.rb
CHANGED
@@ -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
|
data/lib/scout_apm/middleware.rb
CHANGED
@@ -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
|
-
|
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"
|
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.2.
|
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-
|
12
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|