scout_apm 1.2.9 → 1.2.10

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: 37dccd68e9841fb4be84b21b542423f4923dfee5
4
- data.tar.gz: c29e6ac3d99fbbd612baf124c6e2d76e68933e27
3
+ metadata.gz: d6e3fc97dff8ae1961d76b52394b1352d0b9ed37
4
+ data.tar.gz: ec255a3987a94f40a009bb152f07cbc00a6763cc
5
5
  SHA512:
6
- metadata.gz: 34d1715eff899c93e04962bf4b3e80cc2e448cc4900a591fe180ade13973db7593a32a132d4f8b135298d4030911f580fbe472007d8bb42fc0c639245a48f236
7
- data.tar.gz: 0c10d15966c2ac5797dda63978ccde80af58dfa59f584d9ddb63cd39d29de2cf97c7b1e47a22f29ade4952ebe28c2bcb78d4be6c0c6366aabd221aa4417dfa0d
6
+ metadata.gz: 5d5b03e83afd811e9cf3a9569affdac111e98d78e2668c86bd0ed7cdbca9853e667392f4cb4d6e5820ee9bb3d9841799f9098988dc47e05698f4be87e3d02f52
7
+ data.tar.gz: 01605ef204077472adec76c6607cecc0d50263faf8ee2b00550d85386b78bda4d2ab5a9edd548b9a2adf97ee2ec8547597e024e0713336bf9ab30d1a75cebc34
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.2.10
2
+
3
+ * Improve exit handler. It wasn't being run during shutdown in some cases.
4
+
1
5
  # 1.2.9
2
6
 
3
7
  * Uses ActiveRecord::Base.configurations to access database adapter across all versions of Rails 3.0+.
@@ -113,7 +113,6 @@ module ScoutApm
113
113
  # hook is inserted to start the background worker after forking.
114
114
  if start_background_worker?
115
115
  start_background_worker
116
- handle_exit
117
116
  logger.info "Scout Agent [#{ScoutApm::VERSION}] Initialized"
118
117
  elsif environment.background_job_integration
119
118
  environment.background_job_integration.install
@@ -130,13 +129,25 @@ module ScoutApm
130
129
  AppServerLoad.new.run
131
130
  end
132
131
 
133
- def exit_handler_unsupported?
134
- environment.sinatra? || environment.jruby? || environment.rubinius?
132
+ def exit_handler_supported?
133
+ if environment.sinatra?
134
+ logger.debug "Exit handler not supported for Sinatra"
135
+ false
136
+ elsif environment.jruby?
137
+ logger.debug "Exit handler not supported for JRuby"
138
+ false
139
+ elsif environment.rubinius?
140
+ logger.debug "Exit handler not supported for Rubinius"
141
+ false
142
+ else
143
+ true
144
+ end
135
145
  end
136
146
 
137
147
  # at_exit, calls Agent#shutdown to wrapup metric reporting.
138
- def handle_exit
139
- logger.debug "Exit handler not supported" and return if exit_handler_unsupported?
148
+ def install_exit_handler
149
+ logger.debug "Shutdown handler not supported" and return unless exit_handler_supported?
150
+ logger.debug "Installing Shutdown Handler"
140
151
 
141
152
  at_exit do
142
153
  logger.info "Shutting down Scout Agent"
@@ -193,6 +204,9 @@ module ScoutApm
193
204
  def start_background_worker
194
205
  logger.info "Not starting background worker, already started" and return if background_worker_running?
195
206
  logger.info "Initializing worker thread."
207
+
208
+ install_exit_handler
209
+
196
210
  @background_worker = ScoutApm::BackgroundWorker.new
197
211
  @background_worker_thread = Thread.new do
198
212
  @background_worker.start {
@@ -168,7 +168,7 @@ module ScoutApm
168
168
  ### framework checks
169
169
 
170
170
  def sinatra?
171
- defined?(Sinatra::Application)
171
+ framework_integration.name == :sinatra
172
172
  end
173
173
 
174
174
  end # class Environemnt
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "1.2.9"
2
+ VERSION = "1.2.10"
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.9
4
+ version: 1.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  version: '0'
176
176
  requirements: []
177
177
  rubyforge_project: scout_apm
178
- rubygems_version: 2.4.8
178
+ rubygems_version: 2.2.2
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: Ruby application performance monitoring