scout_apm 2.2.0.pre3 → 2.3.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/CHANGELOG.markdown +147 -2
  4. data/Guardfile +43 -0
  5. data/Rakefile +2 -2
  6. data/ext/allocations/allocations.c +6 -0
  7. data/ext/allocations/extconf.rb +1 -0
  8. data/ext/rusage/README.md +26 -0
  9. data/ext/rusage/extconf.rb +5 -0
  10. data/ext/rusage/rusage.c +52 -0
  11. data/lib/scout_apm.rb +28 -15
  12. data/lib/scout_apm/agent.rb +89 -37
  13. data/lib/scout_apm/agent/logging.rb +6 -1
  14. data/lib/scout_apm/agent/reporting.rb +9 -6
  15. data/lib/scout_apm/app_server_load.rb +21 -10
  16. data/lib/scout_apm/attribute_arranger.rb +6 -3
  17. data/lib/scout_apm/background_job_integrations/delayed_job.rb +71 -1
  18. data/lib/scout_apm/background_job_integrations/resque.rb +85 -0
  19. data/lib/scout_apm/background_job_integrations/sidekiq.rb +22 -20
  20. data/lib/scout_apm/background_recorder.rb +43 -0
  21. data/lib/scout_apm/background_worker.rb +19 -15
  22. data/lib/scout_apm/config.rb +138 -28
  23. data/lib/scout_apm/db_query_metric_set.rb +80 -0
  24. data/lib/scout_apm/db_query_metric_stats.rb +102 -0
  25. data/lib/scout_apm/debug.rb +37 -0
  26. data/lib/scout_apm/environment.rb +22 -15
  27. data/lib/scout_apm/git_revision.rb +51 -0
  28. data/lib/scout_apm/histogram.rb +11 -2
  29. data/lib/scout_apm/instant/assets/xmlhttp_instrumentation.html +2 -2
  30. data/lib/scout_apm/instant/middleware.rb +196 -54
  31. data/lib/scout_apm/instruments/action_controller_rails_3_rails4.rb +89 -68
  32. data/lib/scout_apm/instruments/action_view.rb +49 -0
  33. data/lib/scout_apm/instruments/active_record.rb +127 -3
  34. data/lib/scout_apm/instruments/grape.rb +4 -3
  35. data/lib/scout_apm/instruments/middleware_detailed.rb +4 -6
  36. data/lib/scout_apm/instruments/mongoid.rb +24 -3
  37. data/lib/scout_apm/instruments/net_http.rb +7 -2
  38. data/lib/scout_apm/instruments/percentile_sampler.rb +36 -19
  39. data/lib/scout_apm/instruments/process/process_cpu.rb +3 -2
  40. data/lib/scout_apm/instruments/process/process_memory.rb +3 -3
  41. data/lib/scout_apm/instruments/resque.rb +40 -0
  42. data/lib/scout_apm/layaway.rb +67 -28
  43. data/lib/scout_apm/layer.rb +19 -59
  44. data/lib/scout_apm/layer_children_set.rb +77 -0
  45. data/lib/scout_apm/layer_converters/allocation_metric_converter.rb +5 -6
  46. data/lib/scout_apm/layer_converters/converter_base.rb +201 -14
  47. data/lib/scout_apm/layer_converters/database_converter.rb +55 -0
  48. data/lib/scout_apm/layer_converters/depth_first_walker.rb +22 -10
  49. data/lib/scout_apm/layer_converters/error_converter.rb +5 -7
  50. data/lib/scout_apm/layer_converters/find_layer_by_type.rb +34 -0
  51. data/lib/scout_apm/layer_converters/histograms.rb +14 -0
  52. data/lib/scout_apm/layer_converters/job_converter.rb +36 -50
  53. data/lib/scout_apm/layer_converters/metric_converter.rb +17 -19
  54. data/lib/scout_apm/layer_converters/request_queue_time_converter.rb +10 -12
  55. data/lib/scout_apm/layer_converters/slow_job_converter.rb +41 -115
  56. data/lib/scout_apm/layer_converters/slow_request_converter.rb +33 -117
  57. data/lib/scout_apm/limited_layer.rb +126 -0
  58. data/lib/scout_apm/metric_meta.rb +0 -5
  59. data/lib/scout_apm/metric_set.rb +9 -1
  60. data/lib/scout_apm/metric_stats.rb +7 -8
  61. data/lib/scout_apm/rack.rb +26 -0
  62. data/lib/scout_apm/remote/message.rb +23 -0
  63. data/lib/scout_apm/remote/recorder.rb +57 -0
  64. data/lib/scout_apm/remote/router.rb +49 -0
  65. data/lib/scout_apm/remote/server.rb +58 -0
  66. data/lib/scout_apm/reporter.rb +51 -15
  67. data/lib/scout_apm/request_histograms.rb +4 -0
  68. data/lib/scout_apm/request_manager.rb +2 -1
  69. data/lib/scout_apm/scored_item_set.rb +7 -0
  70. data/lib/scout_apm/serializers/db_query_serializer_to_json.rb +15 -0
  71. data/lib/scout_apm/serializers/histograms_serializer_to_json.rb +21 -0
  72. data/lib/scout_apm/serializers/payload_serializer.rb +10 -3
  73. data/lib/scout_apm/serializers/payload_serializer_to_json.rb +6 -6
  74. data/lib/scout_apm/serializers/slow_jobs_serializer_to_json.rb +2 -1
  75. data/lib/scout_apm/server_integrations/puma.rb +5 -2
  76. data/lib/scout_apm/slow_job_policy.rb +1 -10
  77. data/lib/scout_apm/slow_job_record.rb +6 -1
  78. data/lib/scout_apm/slow_request_policy.rb +1 -10
  79. data/lib/scout_apm/slow_transaction.rb +20 -2
  80. data/lib/scout_apm/store.rb +66 -12
  81. data/lib/scout_apm/synchronous_recorder.rb +26 -0
  82. data/lib/scout_apm/tracked_request.rb +136 -71
  83. data/lib/scout_apm/utils/active_record_metric_name.rb +8 -4
  84. data/lib/scout_apm/utils/backtrace_parser.rb +3 -3
  85. data/lib/scout_apm/utils/gzip_helper.rb +24 -0
  86. data/lib/scout_apm/utils/numbers.rb +14 -0
  87. data/lib/scout_apm/utils/scm.rb +14 -0
  88. data/lib/scout_apm/version.rb +1 -1
  89. data/scout_apm.gemspec +5 -4
  90. data/test/test_helper.rb +18 -0
  91. data/test/unit/config_test.rb +59 -8
  92. data/test/unit/db_query_metric_set_test.rb +56 -0
  93. data/test/unit/db_query_metric_stats_test.rb +113 -0
  94. data/test/unit/git_revision_test.rb +15 -0
  95. data/test/unit/histogram_test.rb +14 -0
  96. data/test/unit/instruments/net_http_test.rb +21 -0
  97. data/test/unit/instruments/percentile_sampler_test.rb +137 -0
  98. data/test/unit/layaway_test.rb +20 -0
  99. data/test/unit/layer_children_set_test.rb +88 -0
  100. data/test/unit/layer_converters/depth_first_walker_test.rb +66 -0
  101. data/test/unit/layer_converters/metric_converter_test.rb +22 -0
  102. data/test/unit/layer_converters/stubs.rb +33 -0
  103. data/test/unit/limited_layer_test.rb +53 -0
  104. data/test/unit/remote/test_message.rb +13 -0
  105. data/test/unit/remote/test_router.rb +33 -0
  106. data/test/unit/remote/test_server.rb +15 -0
  107. data/test/unit/serializers/payload_serializer_test.rb +3 -12
  108. data/test/unit/store_test.rb +66 -0
  109. data/test/unit/test_tracked_request.rb +87 -0
  110. data/test/unit/utils/active_record_metric_name_test.rb +8 -0
  111. data/test/unit/utils/backtrace_parser_test.rb +5 -0
  112. data/test/unit/utils/numbers_test.rb +15 -0
  113. data/test/unit/utils/scm.rb +17 -0
  114. metadata +125 -30
  115. data/ext/stacks/extconf.rb +0 -37
  116. data/ext/stacks/scout_atomics.h +0 -86
  117. data/ext/stacks/stacks.c +0 -811
  118. data/lib/scout_apm/capacity.rb +0 -57
  119. data/lib/scout_apm/deploy_integrations/capistrano_2.cap +0 -12
  120. data/lib/scout_apm/deploy_integrations/capistrano_2.rb +0 -83
  121. data/lib/scout_apm/deploy_integrations/capistrano_3.cap +0 -12
  122. data/lib/scout_apm/deploy_integrations/capistrano_3.rb +0 -88
  123. data/lib/scout_apm/instruments/delayed_job.rb +0 -57
  124. data/lib/scout_apm/serializers/deploy_serializer.rb +0 -16
  125. data/lib/scout_apm/trace_compactor.rb +0 -312
  126. data/lib/scout_apm/utils/fake_stacks.rb +0 -87
  127. data/tester.rb +0 -53
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4fa1f78b691cca73f89e5f79902cdc097633773
4
- data.tar.gz: da4c781988cd5996d6d565b42d5ce25e90e4608a
3
+ metadata.gz: 120874f68724447c58563d1cf6dca52a33358713
4
+ data.tar.gz: ba7281a8b6d1d237d6df4b31d8de16e8b3f329b8
5
5
  SHA512:
6
- metadata.gz: dc8f935276423d6cb568af1dded73c38af744747b07fb8ed390a0f3f968c6ff7188e912da1acd1c3599d683a1ee8160196ff7756c2b55c384b4584342e677ca9
7
- data.tar.gz: e5709ffa058e1ffed9d16bc37733f38c0d777f1d33d597447f2d38c7a168635ecbca9d13540be7baa3a8e84a8f082b68ce23b2a62b3d92b7cb0c103010443bc5
6
+ metadata.gz: ddcc5fc87345bcda9787a2227ddc10d5ecbd16c6fd05c5b5d771082afc72b2e9b0b7ac2046bb34bb6f8bf78ef5420221ef44b501c9055a479522cfe177820a9c
7
+ data.tar.gz: a0726334d47ca7e4a094c97335dff2bd873ef11c4181e1d53f6904994cb648cfedd210d74e4581dcf433517b7fbce33890d57c98d04240c9cd94855b79530ee7
data/.gitignore CHANGED
@@ -17,4 +17,4 @@ test/tmp/*coverage/*
17
17
  coverage/*
18
18
  lib/*.bundle
19
19
  lib/*.so
20
- **/.RUBYARCHDIR.time
20
+ log/scout_apm.log
data/CHANGELOG.markdown CHANGED
@@ -1,6 +1,151 @@
1
- # 2.2.0
1
+ # 2.3.0
2
2
 
3
- * ScoutProf BETA
3
+ Note: ScoutApm Agent version 2.2.0 was the initial ScoutProf agent that was
4
+ determined quickly to be a big enough change to warrant the move to 3.0. We are not
5
+ reusing that version number to avoid confusion.
6
+
7
+ * Deeper database query instrumentation. The agent now collects app-wide
8
+ database usage on every call. This will allow you to better identify
9
+ persistently slow queries, and capacity bottlenecks.
10
+ * Optimize the approach used during recording each request to avoid unnecessary
11
+ work, improving performance
12
+
13
+ # 2.1.32
14
+
15
+ * Better naming when using Resque + ActiveJob
16
+ * Better naming when using Sidekiq + DelayedExtension
17
+
18
+ # 2.1.31
19
+
20
+ * Better detection of Resque queue names
21
+ * Fix passing arguments through Active Record instrumentation. (Thanks to Nick Quaranto for providing the fix)
22
+ * Stricter checks to prevent agent from starting in Rails console
23
+
24
+ # 2.1.30
25
+
26
+ * Add Resque support.
27
+
28
+ # 2.1.29
29
+
30
+ * Add `scm_subdirectory` option. Useful for when your app code does not live in your SCM root directory.
31
+
32
+ # 2.1.28
33
+
34
+ * Changes to app server load data
35
+
36
+ # 2.1.27
37
+
38
+ * Don't attempt to call `current_layer.type` on nil
39
+
40
+ # 2.1.26
41
+
42
+ * Bug fix [4b188d6](https://github.com/scoutapp/scout_apm_ruby/commit/4b188d698852c86b86d8768ea5b37d706ce544fe)
43
+
44
+ # 2.1.25
45
+
46
+ * Automatically instrument API and Metal controllers.
47
+
48
+ # 2.1.24
49
+
50
+ * Capture additional layers of application backtrace frames. (From 3 -> 8)
51
+
52
+ # 2.1.23
53
+
54
+ * Extend Mongoid instrumentation to 6.x
55
+
56
+ # 2.1.22
57
+
58
+ * Add DevTrace support for newest 4.2.x and 5.x versions of Rails
59
+
60
+ # 2.1.21
61
+
62
+ * Fix edge case, causing DevTrace to fail
63
+ * Add debug tooling, allowing custom functions to be inserted into the agent at
64
+ key points.
65
+
66
+ # 2.1.20
67
+
68
+ * Add a `detailed_middleware` boolean configuration option to capture
69
+ per-middleware data, as opposed to the default of aggregating all middleware
70
+ together. This has a small amount of additional overhead, approximately
71
+ 10-15ms per request.
72
+
73
+ # 2.1.19
74
+
75
+ * Log all configuration settings at start when log level is debug
76
+ * Tune DelayedJob class name detection
77
+
78
+ # 2.1.18
79
+
80
+ * Max layaway file threshold limit
81
+
82
+ # 2.1.17
83
+
84
+ * Additional logging around file system usage
85
+
86
+ # 2.1.16
87
+
88
+ * Extract the name correctly for DelayedJob workers run via ActiveJob
89
+
90
+ # 2.1.15
91
+
92
+ * Limit memory usage for very long running requests.
93
+
94
+ # 2.1.14
95
+
96
+ * Add TrackedRequest#ignore_request! to entirely ignore and stop capturing a
97
+ certain request. Use in your code by calling:
98
+ ScoutApm::RequestManager.lookup.ignore_request!
99
+
100
+ # 2.1.13
101
+
102
+ * Rework Delayed Job instrumentation to not interfere with other instruments.
103
+
104
+ # 2.1.12
105
+
106
+ * Revert 2.1.11's Delayed Job change - caused issues in a handful of environments
107
+
108
+ # 2.1.11
109
+
110
+ * Support alternate methods of launching Delayed Job
111
+
112
+ # 2.1.10
113
+
114
+ * Fix issue getting a default Application Name when it wasn't explicitly set
115
+
116
+ # 2.1.9
117
+
118
+ * Send raw histograms of response time, enabling more accurate 95th %iles
119
+ * Raw histograms are used in Apdex calculations
120
+ * Gzip payloads
121
+ * Fix Mongoid (5.0) + Mongo (2.1) support
122
+ * Initial Delayed Job support
123
+ * Limit max metric size of a trace to 500.
124
+
125
+
126
+ # 2.1.8
127
+
128
+ * Adds Git revision detection, which is reported on app load and associated with transaction traces
129
+
130
+ # 2.1.7
131
+
132
+ * Fix allocations extension compilation on Ruby 1.8.7
133
+
134
+ # 2.1.6
135
+
136
+ * Support older versions of Grape (0.10 onward)
137
+ * Vendor rusage library
138
+ * Fix double-exit that caused error messages when running under Passenger
139
+
140
+ # 2.1.5
141
+
142
+ * Be less strict loading Rails environments that don't have a matching
143
+ scout_apm.yml section. Previously we raised, now we log and continue
144
+ to load with the ENV settings
145
+ * Fix a memory leak in error recovery code
146
+ * Fix a minor race condition in data coordination between processes.
147
+ * There was a tiny sliver of a window where a lock wasn't held, and it caused
148
+ an exception to be raised.
4
149
 
5
150
  # 2.1.4
6
151
 
data/Guardfile ADDED
@@ -0,0 +1,43 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ guard :minitest do
19
+ # with Minitest::Unit
20
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
21
+ watch(%r{^test/(.*)\/?(.*)_test\.rb$})
22
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
23
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
24
+
25
+ # with Minitest::Spec
26
+ # watch(%r{^spec/(.*)_spec\.rb$})
27
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
28
+ # watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
29
+
30
+ # Rails 4
31
+ # watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
32
+ # watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
33
+ # watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
34
+ # watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
35
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
36
+ # watch(%r{^test/.+_test\.rb$})
37
+ # watch(%r{^test/test_helper\.rb$}) { 'test' }
38
+
39
+ # Rails < 4
40
+ # watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
41
+ # watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
42
+ # watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
43
+ end
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,5 +21,5 @@ end
21
21
  # Rake Compiler
22
22
  require 'rake/extensiontask'
23
23
  Rake::ExtensionTask.new('allocations')
24
- Rake::ExtensionTask.new('stacks')
24
+ Rake::ExtensionTask.new('rusage')
25
25
 
@@ -1,4 +1,8 @@
1
+ #ifdef HAVE_RUBY_RUBY_H
1
2
  #include <ruby/ruby.h>
3
+ #else // Ruby <= 1.8.7
4
+ #include <ruby.h>
5
+ #endif
2
6
 
3
7
  VALUE mScoutApm;
4
8
  VALUE mInstruments;
@@ -52,6 +56,7 @@ void Init_allocations()
52
56
  mInstruments = rb_define_module_under(mScoutApm, "Instruments");
53
57
  cAllocations = rb_define_class_under(mInstruments, "Allocations", rb_cObject);
54
58
  rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
59
+ rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
55
60
  rb_define_const(cAllocations, "ENABLED", Qtrue);
56
61
  Init_hooks(mScoutApm);
57
62
  }
@@ -74,6 +79,7 @@ void Init_allocations()
74
79
  mInstruments = rb_define_module_under(mScoutApm, "Instruments");
75
80
  cAllocations = rb_define_class_under(mInstruments, "Allocations", rb_cObject);
76
81
  rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
82
+ rb_define_singleton_method(cAllocations, "count", get_allocation_count, 0);
77
83
  rb_define_const(cAllocations, "ENABLED", Qfalse);
78
84
  Init_hooks(mScoutApm);
79
85
  }
@@ -1,3 +1,4 @@
1
1
  require 'mkmf'
2
2
 
3
+ have_header("ruby/ruby.h") # Needed to check for Ruby <= 1.8.7
3
4
  create_makefile('allocations')
@@ -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
+ }
data/lib/scout_apm.rb CHANGED
@@ -14,7 +14,7 @@ require 'socket'
14
14
  require 'thread'
15
15
  require 'time'
16
16
  require 'yaml'
17
- require 'rbconfig'
17
+ require 'webrick'
18
18
 
19
19
  #####################################
20
20
  # Gem Requires
@@ -26,8 +26,11 @@ require 'rusage'
26
26
  #####################################
27
27
  require 'scout_apm/version'
28
28
 
29
+ require 'scout_apm/debug'
29
30
  require 'scout_apm/tracked_request'
30
31
  require 'scout_apm/layer'
32
+ require 'scout_apm/limited_layer'
33
+ require 'scout_apm/layer_children_set'
31
34
  require 'scout_apm/request_manager'
32
35
  require 'scout_apm/call_set'
33
36
 
@@ -37,9 +40,12 @@ require 'scout_apm/layer_converters/error_converter'
37
40
  require 'scout_apm/layer_converters/job_converter'
38
41
  require 'scout_apm/layer_converters/slow_job_converter'
39
42
  require 'scout_apm/layer_converters/metric_converter'
43
+ require 'scout_apm/layer_converters/database_converter'
40
44
  require 'scout_apm/layer_converters/slow_request_converter'
41
45
  require 'scout_apm/layer_converters/request_queue_time_converter'
42
46
  require 'scout_apm/layer_converters/allocation_metric_converter'
47
+ require 'scout_apm/layer_converters/histograms'
48
+ require 'scout_apm/layer_converters/find_layer_by_type'
43
49
 
44
50
  require 'scout_apm/server_integrations/passenger'
45
51
  require 'scout_apm/server_integrations/puma'
@@ -51,6 +57,7 @@ require 'scout_apm/server_integrations/null'
51
57
 
52
58
  require 'scout_apm/background_job_integrations/sidekiq'
53
59
  require 'scout_apm/background_job_integrations/delayed_job'
60
+ require 'scout_apm/background_job_integrations/resque'
54
61
 
55
62
  require 'scout_apm/framework_integrations/rails_2'
56
63
  require 'scout_apm/framework_integrations/rails_3_or_4'
@@ -63,9 +70,6 @@ require 'scout_apm/platform_integrations/server'
63
70
 
64
71
  require 'scout_apm/histogram'
65
72
 
66
- require 'scout_apm/deploy_integrations/capistrano_3'
67
- # require 'scout_apm/deploy_integrations/capistrano_2'
68
-
69
73
  require 'scout_apm/instruments/net_http'
70
74
  require 'scout_apm/instruments/http_client'
71
75
  require 'scout_apm/instruments/moped'
@@ -73,26 +77,20 @@ require 'scout_apm/instruments/mongoid'
73
77
  require 'scout_apm/instruments/redis'
74
78
  require 'scout_apm/instruments/influxdb'
75
79
  require 'scout_apm/instruments/elasticsearch'
76
- require 'scout_apm/instruments/delayed_job'
77
80
  require 'scout_apm/instruments/active_record'
78
81
  require 'scout_apm/instruments/action_controller_rails_2'
79
82
  require 'scout_apm/instruments/action_controller_rails_3_rails4'
80
83
  require 'scout_apm/instruments/middleware_summary'
81
- # require 'scout_apm/instruments/middleware_detailed' # Currently disabled functionality, see the file for details.
84
+ require 'scout_apm/instruments/middleware_detailed' # Disabled by default, see the file for more details
82
85
  require 'scout_apm/instruments/rails_router'
83
86
  require 'scout_apm/instruments/grape'
84
87
  require 'scout_apm/instruments/sinatra'
85
88
  require 'scout_apm/instruments/process/process_cpu'
86
89
  require 'scout_apm/instruments/process/process_memory'
87
90
  require 'scout_apm/instruments/percentile_sampler'
91
+ require 'scout_apm/instruments/action_view'
88
92
  require 'allocations'
89
93
 
90
- begin
91
- require 'stacks'
92
- rescue LoadError
93
- require 'scout_apm/utils/fake_stacks'
94
- end
95
-
96
94
  require 'scout_apm/app_server_load'
97
95
 
98
96
  require 'scout_apm/ignored_uris.rb'
@@ -101,9 +99,12 @@ require 'scout_apm/utils/backtrace_parser'
101
99
  require 'scout_apm/utils/installed_gems'
102
100
  require 'scout_apm/utils/klass_helper'
103
101
  require 'scout_apm/utils/null_logger'
102
+ require 'scout_apm/utils/scm'
104
103
  require 'scout_apm/utils/sql_sanitizer'
105
104
  require 'scout_apm/utils/time'
106
105
  require 'scout_apm/utils/unique_id'
106
+ require 'scout_apm/utils/numbers'
107
+ require 'scout_apm/utils/gzip_helper'
107
108
 
108
109
  require 'scout_apm/config'
109
110
  require 'scout_apm/environment'
@@ -117,15 +118,18 @@ require 'scout_apm/background_worker'
117
118
  require 'scout_apm/bucket_name_splitter'
118
119
  require 'scout_apm/stack_item'
119
120
  require 'scout_apm/metric_set'
121
+ require 'scout_apm/db_query_metric_set'
120
122
  require 'scout_apm/store'
121
123
  require 'scout_apm/fake_store'
122
124
  require 'scout_apm/tracer'
123
125
  require 'scout_apm/context'
124
126
  require 'scout_apm/instant_reporting'
125
- require 'scout_apm/trace_compactor'
127
+ require 'scout_apm/background_recorder'
128
+ require 'scout_apm/synchronous_recorder'
126
129
 
127
130
  require 'scout_apm/metric_meta'
128
131
  require 'scout_apm/metric_stats'
132
+ require 'scout_apm/db_query_metric_stats'
129
133
  require 'scout_apm/slow_transaction'
130
134
  require 'scout_apm/slow_job_record'
131
135
  require 'scout_apm/scored_item_set'
@@ -134,22 +138,31 @@ require 'scout_apm/slow_job_policy'
134
138
  require 'scout_apm/job_record'
135
139
  require 'scout_apm/request_histograms'
136
140
 
137
- require 'scout_apm/capacity'
138
141
  require 'scout_apm/attribute_arranger'
142
+ require 'scout_apm/git_revision'
139
143
 
140
144
  require 'scout_apm/serializers/payload_serializer'
141
145
  require 'scout_apm/serializers/payload_serializer_to_json'
142
146
  require 'scout_apm/serializers/jobs_serializer_to_json'
143
147
  require 'scout_apm/serializers/slow_jobs_serializer_to_json'
144
148
  require 'scout_apm/serializers/metrics_to_json_serializer'
149
+ require 'scout_apm/serializers/histograms_serializer_to_json'
150
+ require 'scout_apm/serializers/db_query_serializer_to_json'
145
151
  require 'scout_apm/serializers/directive_serializer'
146
152
  require 'scout_apm/serializers/app_server_load_serializer'
147
- require 'scout_apm/serializers/deploy_serializer'
148
153
 
149
154
  require 'scout_apm/middleware'
150
155
 
151
156
  require 'scout_apm/instant/middleware'
152
157
 
158
+ require 'scout_apm/rack'
159
+
160
+ require 'scout_apm/remote/server'
161
+ require 'scout_apm/remote/router'
162
+ require 'scout_apm/remote/message'
163
+ require 'scout_apm/remote/recorder'
164
+ require 'scout_apm/instruments/resque'
165
+
153
166
  if defined?(Rails) && defined?(Rails::VERSION) && defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR >= 3 && defined?(Rails::Railtie)
154
167
  module ScoutApm
155
168
  class Railtie < Rails::Railtie