scout_apm 2.1.5 → 2.1.6

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: 3e07d333b6388ad233485d64c3c1f460a0267873
4
- data.tar.gz: 2fae8e481a1c38dc02aa99f77fef443bc4e30ec4
3
+ metadata.gz: f03097407f7dbd49d3e27cd565e9e560cde514dd
4
+ data.tar.gz: 6e5b6ecc1e77af62d996c2e28dd223c5c3cedbc7
5
5
  SHA512:
6
- metadata.gz: 119d47bb1e32990a8841e34aca493b614b3ac060a43a77de6779e4bbf7d1b8d6be7f4630bcb5ee2672f9bb0ddb4b7a4f2e83962807d78ca0181e22d923f03a30
7
- data.tar.gz: 339f928af02ecfcdbf82b546e2666f86bba4fd7aef9f34e95637992b4d61d3070873ab17dfebbcf6b5a41b06f6179cc1c3ab3b60f33dbe8cc88608d1fa77c271
6
+ metadata.gz: 15283444582d7b965d68b30ff095e908e0d3fd84076ecae08e8e352c0eff64001811e6e5affe7736483bb195bc478498eb07c68ca1c4662028eee3b2e7f6b899
7
+ data.tar.gz: ed60c8e18e26cc79b8535c4c693cac1d6fb775961a38f38cf5ce709255ff93e67d9bc950aaa7d075ec1a49d48ad1d76c52176068baac8cbdaa542b7ed5816d44
@@ -1,5 +1,12 @@
1
1
  # master
2
2
 
3
+ # 2.1.6
4
+
5
+ * Support older versions of Grape (0.10 onward)
6
+ * Fix issue with complex AR queries
7
+ * Vendor rusage library
8
+ * Fix double-exit that caused error messages when running under Passenger
9
+
3
10
  # 2.1.5
4
11
 
5
12
  * Be less strict loading Rails environments that don't have a matching
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require "bundler/gem_tasks"
3
3
  task :default => :test
4
4
 
5
5
  desc "Run Unit Tests"
6
- task :test do
6
+ task :test => [:compile] do
7
7
  $: << File.expand_path(File.dirname(__FILE__) + "/test")
8
8
  Dir.glob('./test/**/*_test.rb').each { |file| require file }
9
9
  end
@@ -21,4 +21,5 @@ end
21
21
  # Rake Compiler
22
22
  require 'rake/extensiontask'
23
23
  Rake::ExtensionTask.new('allocations')
24
+ Rake::ExtensionTask.new('rusage')
24
25
 
@@ -0,0 +1,26 @@
1
+ This is a vendored copy of the rusage gem.
2
+
3
+
4
+ = rusage
5
+
6
+ * http://github.com/sandofsky/rusage
7
+
8
+ == DESCRIPTION:
9
+
10
+ A gem that calls getrusage to get details on the current process.
11
+
12
+ Ripped out of the proc/wait3 library, originally written by Daniel J. Berger.
13
+
14
+ http://raa.ruby-lang.org/project/proc-wait3/
15
+
16
+ == LICENSE:
17
+
18
+ Inherits the Artistic License 2.0 from proc/wait3.
19
+
20
+ == COPYRIGHT:
21
+
22
+ The original code is still copyright Daniel J. Berger.
23
+
24
+ rusage gem is copyright Ben Sandofsky.
25
+
26
+ Code changes after being added to this repository are copyright Zimuth, Inc.
@@ -0,0 +1,5 @@
1
+ require 'mkmf'
2
+
3
+ dir_config("rusage")
4
+
5
+ create_makefile("rusage")
@@ -0,0 +1,52 @@
1
+ // VERSION = "x.y.z"
2
+ #include <ruby.h>
3
+ #include <sys/resource.h>
4
+
5
+ VALUE v_usage_struct;
6
+
7
+ static VALUE do_rusage_get(int who){
8
+ struct rusage r;
9
+ int ret;
10
+
11
+ ret = getrusage(who, &r);
12
+ if(ret == -1)
13
+ rb_sys_fail("getrusage");
14
+
15
+ return rb_struct_new(v_usage_struct,
16
+ rb_float_new((double)r.ru_utime.tv_sec+(double)r.ru_utime.tv_usec/1e6),
17
+ rb_float_new((double)r.ru_stime.tv_sec+(double)r.ru_stime.tv_usec/1e6),
18
+ LONG2NUM(r.ru_maxrss),
19
+ LONG2NUM(r.ru_ixrss),
20
+ LONG2NUM(r.ru_idrss),
21
+ LONG2NUM(r.ru_isrss),
22
+ LONG2NUM(r.ru_minflt),
23
+ LONG2NUM(r.ru_majflt),
24
+ LONG2NUM(r.ru_nswap),
25
+ LONG2NUM(r.ru_inblock),
26
+ LONG2NUM(r.ru_oublock),
27
+ LONG2NUM(r.ru_msgsnd),
28
+ LONG2NUM(r.ru_msgrcv),
29
+ LONG2NUM(r.ru_nsignals),
30
+ LONG2NUM(r.ru_nvcsw),
31
+ LONG2NUM(r.ru_nivcsw)
32
+ );
33
+ }
34
+
35
+ static VALUE rusage_get(int argc, VALUE* argv, VALUE mod){
36
+ return do_rusage_get(RUSAGE_SELF);
37
+ }
38
+
39
+ static VALUE crusage_get(int argc, VALUE* argv, VALUE mod){
40
+ return do_rusage_get(RUSAGE_CHILDREN);
41
+ }
42
+
43
+ void Init_rusage(){
44
+ v_usage_struct =
45
+ rb_struct_define("RUsage","utime","stime","maxrss","ixrss","idrss",
46
+ "isrss","minflt","majflt","nswap","inblock","oublock","msgsnd",
47
+ "msgrcv","nsignals","nvcsw","nivcsw",NULL
48
+ );
49
+
50
+ rb_define_module_function(rb_mProcess, "rusage", rusage_get, -1);
51
+ rb_define_module_function(rb_mProcess, "crusage", crusage_get, -1);
52
+ }
@@ -203,18 +203,20 @@ module ScoutApm
203
203
  # It does not attempt to actually report metrics.
204
204
  def shutdown
205
205
  logger.info "Shutting down ScoutApm"
206
+
206
207
  return if !started?
207
208
 
209
+ return if @shutdown
210
+ @shutdown = true
211
+
208
212
  if @background_worker
209
213
  logger.info("Stopping background worker")
210
214
  @background_worker.stop
211
215
  store.write_to_layaway(layaway, :force)
212
- end
213
-
214
- logger.debug "Joining background worker thread"
215
- if @background_worker_thread
216
- @background_worker_thread.wakeup
217
- @background_worker_thread.join
216
+ if @background_worker_thread.alive?
217
+ @background_worker_thread.wakeup
218
+ @background_worker_thread.join
219
+ end
218
220
  end
219
221
  end
220
222
 
@@ -29,9 +29,10 @@ module ScoutApm
29
29
  end
30
30
 
31
31
  module GrapeEndpointInstruments
32
- def run_with_scout_instruments
33
- request = ::Grape::Request.new(env)
32
+ def run_with_scout_instruments(*args)
33
+ request = ::Grape::Request.new(env || args.first)
34
34
  req = ScoutApm::RequestManager.lookup
35
+
35
36
  path = ScoutApm::Agent.instance.config.value("uri_reporting") == 'path' ? request.path : request.fullpath
36
37
  req.annotate_request(:uri => path)
37
38
 
@@ -55,7 +56,7 @@ module ScoutApm
55
56
 
56
57
  req.start_layer( ScoutApm::Layer.new("Controller", name) )
57
58
  begin
58
- run_without_scout_instruments
59
+ run_without_scout_instruments(*args)
59
60
  rescue
60
61
  req.error!
61
62
  raise
@@ -1,4 +1,4 @@
1
1
  module ScoutApm
2
- VERSION = "2.1.5"
2
+ VERSION = "2.1.6"
3
3
  end
4
4
 
@@ -19,8 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib","data"]
21
21
  s.extensions << 'ext/allocations/extconf.rb'
22
-
23
- s.add_runtime_dependency "rusage", '~> 0.2.0'
22
+ s.extensions << 'ext/rusage/extconf.rb'
24
23
 
25
24
  s.add_development_dependency "minitest"
26
25
  s.add_development_dependency 'mocha'
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: 2.1.5
4
+ version: 2.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
@@ -11,20 +11,6 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2016-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rusage
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: 0.2.0
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: 0.2.0
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: minitest
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -115,6 +101,7 @@ email:
115
101
  executables: []
116
102
  extensions:
117
103
  - ext/allocations/extconf.rb
104
+ - ext/rusage/extconf.rb
118
105
  extra_rdoc_files: []
119
106
  files:
120
107
  - ".gitignore"
@@ -127,6 +114,9 @@ files:
127
114
  - data/cacert.pem
128
115
  - ext/allocations/allocations.c
129
116
  - ext/allocations/extconf.rb
117
+ - ext/rusage/README.md
118
+ - ext/rusage/extconf.rb
119
+ - ext/rusage/rusage.c
130
120
  - lib/scout_apm.rb
131
121
  - lib/scout_apm/agent.rb
132
122
  - lib/scout_apm/agent/logging.rb