scout_apm 2.6.10 → 3.0.0.pre0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -2
  3. data/.rubocop.yml +3 -11
  4. data/CHANGELOG.markdown +4 -362
  5. data/Gemfile +1 -14
  6. data/README.markdown +7 -52
  7. data/Rakefile +1 -0
  8. data/ext/allocations/allocations.c +1 -7
  9. data/ext/allocations/extconf.rb +0 -1
  10. data/ext/rusage/rusage.c +0 -26
  11. data/ext/stacks/extconf.rb +37 -0
  12. data/ext/stacks/scout_atomics.h +86 -0
  13. data/ext/stacks/stacks.c +811 -0
  14. data/lib/scout_apm/agent/logging.rb +69 -0
  15. data/lib/scout_apm/agent/reporting.rb +126 -0
  16. data/lib/scout_apm/agent.rb +259 -138
  17. data/lib/scout_apm/app_server_load.rb +15 -41
  18. data/lib/scout_apm/attribute_arranger.rb +3 -14
  19. data/lib/scout_apm/background_job_integrations/delayed_job.rb +1 -70
  20. data/lib/scout_apm/background_job_integrations/sidekiq.rb +24 -31
  21. data/lib/scout_apm/background_worker.rb +12 -23
  22. data/lib/scout_apm/capacity.rb +57 -0
  23. data/lib/scout_apm/config.rb +37 -206
  24. data/lib/scout_apm/context.rb +4 -20
  25. data/lib/scout_apm/deploy_integrations/capistrano_2.cap +12 -0
  26. data/lib/scout_apm/deploy_integrations/capistrano_2.rb +83 -0
  27. data/lib/scout_apm/deploy_integrations/capistrano_3.cap +12 -0
  28. data/lib/scout_apm/deploy_integrations/capistrano_3.rb +88 -0
  29. data/lib/scout_apm/environment.rb +28 -42
  30. data/lib/scout_apm/fake_store.rb +0 -12
  31. data/lib/scout_apm/framework_integrations/rails_2.rb +1 -2
  32. data/lib/scout_apm/framework_integrations/rails_3_or_4.rb +6 -17
  33. data/lib/scout_apm/framework_integrations/sinatra.rb +1 -1
  34. data/lib/scout_apm/histogram.rb +3 -12
  35. data/lib/scout_apm/instant/assets/xmlhttp_instrumentation.html +2 -2
  36. data/lib/scout_apm/instant/middleware.rb +54 -202
  37. data/lib/scout_apm/instant_reporting.rb +7 -7
  38. data/lib/scout_apm/instruments/.DS_Store +0 -0
  39. data/lib/scout_apm/instruments/action_controller_rails_2.rb +9 -15
  40. data/lib/scout_apm/instruments/action_controller_rails_3_rails4.rb +76 -124
  41. data/lib/scout_apm/instruments/active_record.rb +29 -324
  42. data/lib/scout_apm/instruments/delayed_job.rb +57 -0
  43. data/lib/scout_apm/instruments/elasticsearch.rb +6 -10
  44. data/lib/scout_apm/instruments/grape.rb +9 -12
  45. data/lib/scout_apm/instruments/http_client.rb +7 -14
  46. data/lib/scout_apm/instruments/influxdb.rb +6 -10
  47. data/lib/scout_apm/instruments/middleware_detailed.rb +11 -15
  48. data/lib/scout_apm/instruments/middleware_summary.rb +5 -11
  49. data/lib/scout_apm/instruments/mongoid.rb +8 -39
  50. data/lib/scout_apm/instruments/moped.rb +6 -11
  51. data/lib/scout_apm/instruments/net_http.rb +9 -27
  52. data/lib/scout_apm/instruments/percentile_sampler.rb +23 -42
  53. data/lib/scout_apm/instruments/process/process_cpu.rb +6 -11
  54. data/lib/scout_apm/instruments/process/process_memory.rb +12 -17
  55. data/lib/scout_apm/instruments/rails_router.rb +6 -12
  56. data/lib/scout_apm/instruments/redis.rb +6 -10
  57. data/lib/scout_apm/instruments/sinatra.rb +4 -5
  58. data/lib/scout_apm/job_record.rb +2 -4
  59. data/lib/scout_apm/layaway.rb +34 -88
  60. data/lib/scout_apm/layaway_file.rb +3 -13
  61. data/lib/scout_apm/layer.rb +60 -25
  62. data/lib/scout_apm/layer_converters/allocation_metric_converter.rb +6 -7
  63. data/lib/scout_apm/layer_converters/converter_base.rb +14 -203
  64. data/lib/scout_apm/layer_converters/depth_first_walker.rb +10 -22
  65. data/lib/scout_apm/layer_converters/error_converter.rb +8 -8
  66. data/lib/scout_apm/layer_converters/job_converter.rb +50 -37
  67. data/lib/scout_apm/layer_converters/metric_converter.rb +19 -18
  68. data/lib/scout_apm/layer_converters/request_queue_time_converter.rb +13 -13
  69. data/lib/scout_apm/layer_converters/slow_job_converter.rb +116 -52
  70. data/lib/scout_apm/layer_converters/slow_request_converter.rb +120 -51
  71. data/lib/scout_apm/metric_meta.rb +5 -0
  72. data/lib/scout_apm/metric_set.rb +1 -9
  73. data/lib/scout_apm/metric_stats.rb +8 -7
  74. data/lib/scout_apm/middleware.rb +9 -7
  75. data/lib/scout_apm/reporter.rb +24 -71
  76. data/lib/scout_apm/request_histograms.rb +0 -12
  77. data/lib/scout_apm/request_manager.rb +7 -5
  78. data/lib/scout_apm/scored_item_set.rb +0 -7
  79. data/lib/scout_apm/serializers/app_server_load_serializer.rb +0 -4
  80. data/lib/scout_apm/serializers/deploy_serializer.rb +16 -0
  81. data/lib/scout_apm/serializers/directive_serializer.rb +0 -4
  82. data/lib/scout_apm/serializers/payload_serializer.rb +4 -11
  83. data/lib/scout_apm/serializers/payload_serializer_to_json.rb +16 -35
  84. data/lib/scout_apm/serializers/slow_jobs_serializer_to_json.rb +1 -2
  85. data/lib/scout_apm/server_integrations/passenger.rb +1 -1
  86. data/lib/scout_apm/server_integrations/puma.rb +2 -5
  87. data/lib/scout_apm/slow_job_policy.rb +13 -25
  88. data/lib/scout_apm/slow_job_record.rb +4 -13
  89. data/lib/scout_apm/slow_request_policy.rb +13 -25
  90. data/lib/scout_apm/slow_transaction.rb +5 -25
  91. data/lib/scout_apm/store.rb +32 -99
  92. data/lib/scout_apm/trace_compactor.rb +312 -0
  93. data/lib/scout_apm/tracer.rb +31 -35
  94. data/lib/scout_apm/tracked_request.rb +95 -262
  95. data/lib/scout_apm/utils/active_record_metric_name.rb +13 -88
  96. data/lib/scout_apm/utils/backtrace_parser.rb +4 -7
  97. data/lib/scout_apm/utils/fake_stacks.rb +87 -0
  98. data/lib/scout_apm/utils/installed_gems.rb +3 -7
  99. data/lib/scout_apm/utils/klass_helper.rb +2 -8
  100. data/lib/scout_apm/utils/null_logger.rb +13 -0
  101. data/lib/scout_apm/utils/sql_sanitizer.rb +5 -16
  102. data/lib/scout_apm/utils/sql_sanitizer_regex.rb +0 -7
  103. data/lib/scout_apm/utils/sql_sanitizer_regex_1_8_7.rb +0 -6
  104. data/lib/scout_apm/utils/unique_id.rb +0 -27
  105. data/lib/scout_apm/version.rb +2 -1
  106. data/lib/scout_apm.rb +25 -84
  107. data/scout_apm.gemspec +3 -17
  108. data/test/test_helper.rb +3 -57
  109. data/test/unit/agent_test.rb +54 -1
  110. data/test/unit/background_job_integrations/sidekiq_test.rb +3 -0
  111. data/test/unit/config_test.rb +12 -25
  112. data/test/unit/context_test.rb +4 -4
  113. data/test/unit/histogram_test.rb +4 -25
  114. data/test/unit/ignored_uris_test.rb +1 -1
  115. data/test/unit/instruments/active_record_instruments_test.rb +5 -0
  116. data/test/unit/layaway_test.rb +2 -62
  117. data/test/unit/serializers/payload_serializer_test.rb +15 -43
  118. data/test/unit/slow_request_policy_test.rb +6 -15
  119. data/test/unit/sql_sanitizer_test.rb +6 -53
  120. data/test/unit/store_test.rb +4 -73
  121. data/test/unit/utils/active_record_metric_name_test.rb +5 -59
  122. data/test/unit/utils/backtrace_parser_test.rb +1 -6
  123. data/tester.rb +53 -0
  124. metadata +28 -229
  125. data/.travis.yml +0 -26
  126. data/Guardfile +0 -43
  127. data/gems/README.md +0 -28
  128. data/gems/octoshark.gemfile +0 -4
  129. data/gems/rails3.gemfile +0 -5
  130. data/gems/rails4.gemfile +0 -4
  131. data/gems/rails5.gemfile +0 -4
  132. data/gems/rails6.gemfile +0 -4
  133. data/lib/scout_apm/agent/exit_handler.rb +0 -65
  134. data/lib/scout_apm/agent/preconditions.rb +0 -81
  135. data/lib/scout_apm/agent_context.rb +0 -261
  136. data/lib/scout_apm/auto_instrument/instruction_sequence.rb +0 -31
  137. data/lib/scout_apm/auto_instrument/layer.rb +0 -23
  138. data/lib/scout_apm/auto_instrument/parser.rb +0 -27
  139. data/lib/scout_apm/auto_instrument/rails.rb +0 -175
  140. data/lib/scout_apm/auto_instrument.rb +0 -5
  141. data/lib/scout_apm/background_job_integrations/legacy_sneakers.rb +0 -55
  142. data/lib/scout_apm/background_job_integrations/que.rb +0 -134
  143. data/lib/scout_apm/background_job_integrations/resque.rb +0 -88
  144. data/lib/scout_apm/background_job_integrations/shoryuken.rb +0 -124
  145. data/lib/scout_apm/background_job_integrations/sneakers.rb +0 -87
  146. data/lib/scout_apm/background_recorder.rb +0 -48
  147. data/lib/scout_apm/db_query_metric_set.rb +0 -97
  148. data/lib/scout_apm/db_query_metric_stats.rb +0 -102
  149. data/lib/scout_apm/debug.rb +0 -37
  150. data/lib/scout_apm/detailed_trace.rb +0 -217
  151. data/lib/scout_apm/error.rb +0 -27
  152. data/lib/scout_apm/error_service/error_buffer.rb +0 -39
  153. data/lib/scout_apm/error_service/error_record.rb +0 -211
  154. data/lib/scout_apm/error_service/ignored_exceptions.rb +0 -66
  155. data/lib/scout_apm/error_service/middleware.rb +0 -32
  156. data/lib/scout_apm/error_service/notifier.rb +0 -33
  157. data/lib/scout_apm/error_service/payload.rb +0 -47
  158. data/lib/scout_apm/error_service/periodic_work.rb +0 -17
  159. data/lib/scout_apm/error_service/railtie.rb +0 -11
  160. data/lib/scout_apm/error_service/sidekiq.rb +0 -80
  161. data/lib/scout_apm/error_service.rb +0 -32
  162. data/lib/scout_apm/extensions/config.rb +0 -87
  163. data/lib/scout_apm/extensions/transaction_callback_payload.rb +0 -74
  164. data/lib/scout_apm/git_revision.rb +0 -59
  165. data/lib/scout_apm/instrument_manager.rb +0 -88
  166. data/lib/scout_apm/instruments/action_view.rb +0 -141
  167. data/lib/scout_apm/instruments/http.rb +0 -48
  168. data/lib/scout_apm/instruments/memcached.rb +0 -43
  169. data/lib/scout_apm/instruments/resque.rb +0 -39
  170. data/lib/scout_apm/instruments/samplers.rb +0 -11
  171. data/lib/scout_apm/layer_children_set.rb +0 -86
  172. data/lib/scout_apm/layer_converters/database_converter.rb +0 -70
  173. data/lib/scout_apm/layer_converters/find_layer_by_type.rb +0 -38
  174. data/lib/scout_apm/layer_converters/histograms.rb +0 -15
  175. data/lib/scout_apm/layer_converters/trace_converter.rb +0 -184
  176. data/lib/scout_apm/limited_layer.rb +0 -126
  177. data/lib/scout_apm/logger.rb +0 -158
  178. data/lib/scout_apm/periodic_work.rb +0 -47
  179. data/lib/scout_apm/rack.rb +0 -26
  180. data/lib/scout_apm/remote/message.rb +0 -27
  181. data/lib/scout_apm/remote/recorder.rb +0 -57
  182. data/lib/scout_apm/remote/router.rb +0 -49
  183. data/lib/scout_apm/remote/server.rb +0 -60
  184. data/lib/scout_apm/reporting.rb +0 -143
  185. data/lib/scout_apm/serializers/db_query_serializer_to_json.rb +0 -15
  186. data/lib/scout_apm/serializers/histograms_serializer_to_json.rb +0 -21
  187. data/lib/scout_apm/synchronous_recorder.rb +0 -30
  188. data/lib/scout_apm/tasks/doctor.rb +0 -75
  189. data/lib/scout_apm/tasks/support.rb +0 -22
  190. data/lib/scout_apm/transaction.rb +0 -13
  191. data/lib/scout_apm/transaction_time_consumed.rb +0 -51
  192. data/lib/scout_apm/utils/gzip_helper.rb +0 -24
  193. data/lib/scout_apm/utils/marshal_logging.rb +0 -90
  194. data/lib/scout_apm/utils/numbers.rb +0 -14
  195. data/lib/scout_apm/utils/scm.rb +0 -14
  196. data/lib/tasks/doctor.rake +0 -11
  197. data/test/tmp/README.md +0 -17
  198. data/test/unit/agent_context_test.rb +0 -15
  199. data/test/unit/auto_instrument/assignments-instrumented.rb +0 -31
  200. data/test/unit/auto_instrument/assignments.rb +0 -31
  201. data/test/unit/auto_instrument/controller-ast.txt +0 -57
  202. data/test/unit/auto_instrument/controller-instrumented.rb +0 -49
  203. data/test/unit/auto_instrument/controller.rb +0 -49
  204. data/test/unit/auto_instrument/rescue_from-instrumented.rb +0 -13
  205. data/test/unit/auto_instrument/rescue_from.rb +0 -13
  206. data/test/unit/auto_instrument_test.rb +0 -54
  207. data/test/unit/db_query_metric_set_test.rb +0 -67
  208. data/test/unit/db_query_metric_stats_test.rb +0 -113
  209. data/test/unit/error_service/error_buffer_test.rb +0 -25
  210. data/test/unit/error_service/ignored_exceptions_test.rb +0 -49
  211. data/test/unit/extensions/periodic_callbacks_test.rb +0 -58
  212. data/test/unit/extensions/transaction_callbacks_test.rb +0 -58
  213. data/test/unit/fake_store_test.rb +0 -10
  214. data/test/unit/git_revision_test.rb +0 -15
  215. data/test/unit/instruments/active_record_test.rb +0 -40
  216. data/test/unit/instruments/net_http_test.rb +0 -27
  217. data/test/unit/instruments/percentile_sampler_test.rb +0 -133
  218. data/test/unit/layer_children_set_test.rb +0 -97
  219. data/test/unit/layer_converters/depth_first_walker_test.rb +0 -70
  220. data/test/unit/layer_converters/metric_converter_test.rb +0 -22
  221. data/test/unit/layer_converters/stubs.rb +0 -33
  222. data/test/unit/limited_layer_test.rb +0 -53
  223. data/test/unit/logger_test.rb +0 -69
  224. data/test/unit/remote/test_message.rb +0 -13
  225. data/test/unit/remote/test_router.rb +0 -33
  226. data/test/unit/remote/test_server.rb +0 -15
  227. data/test/unit/request_histograms_test.rb +0 -17
  228. data/test/unit/tracer_test.rb +0 -76
  229. data/test/unit/tracked_request_test.rb +0 -71
  230. data/test/unit/transaction_test.rb +0 -14
  231. data/test/unit/transaction_time_consumed_test.rb +0 -46
  232. data/test/unit/utils/numbers_test.rb +0 -15
  233. data/test/unit/utils/scm.rb +0 -17
@@ -1,7 +1,6 @@
1
1
  require 'test_helper'
2
2
  require 'scout_apm/utils/active_record_metric_name'
3
3
 
4
-
5
4
  class ActiveRecordMetricNameTest < Minitest::Test
6
5
  # This is a bug report from Андрей Филиппов <tmn.sun@gmail.com>
7
6
  # The code that triggered the bug was: ActiveRecord::Base.connection.execute("%some sql%", :skip_logging)
@@ -10,7 +9,7 @@ class ActiveRecordMetricNameTest < Minitest::Test
10
9
  name = :skip_logging
11
10
 
12
11
  mn = ScoutApm::Utils::ActiveRecordMetricName.new(sql, name)
13
- assert_equal "User/find", mn.to_s
12
+ assert_equal "SQL/Unknown", mn.to_s
14
13
  end
15
14
 
16
15
  def test_postgres_column_lookup
@@ -28,7 +27,7 @@ class ActiveRecordMetricNameTest < Minitest::Test
28
27
  name = "SCHEMA"
29
28
 
30
29
  mn = ScoutApm::Utils::ActiveRecordMetricName.new(sql, name)
31
- assert_equal "SQL/other", mn.to_s
30
+ assert_equal "SQL/Unknown", mn.to_s
32
31
  end
33
32
 
34
33
 
@@ -45,68 +44,15 @@ class ActiveRecordMetricNameTest < Minitest::Test
45
44
  name = nil
46
45
 
47
46
  mn = ScoutApm::Utils::ActiveRecordMetricName.new(sql, name)
48
- assert_equal "User/find", mn.to_s
49
- end
50
-
51
- def test_with_sql_name
52
- sql = %q|INSERT INTO "users" VALUES (1,2,3)|
53
- name = "SQL"
54
-
55
- mn = ScoutApm::Utils::ActiveRecordMetricName.new(sql, name)
56
- assert_equal "User/create", mn.to_s
47
+ assert_equal "SQL/Unknown", mn.to_s
57
48
  end
58
49
 
50
+ # TODO: Determine if there should be a distinction between Unknown and Other.
59
51
  def test_with_custom_name
60
52
  sql = %q|SELECT "users".* FROM "users" /*application:Testapp,controller:public,action:index*/|
61
53
  name = "A whole sentance describing what's what"
62
54
 
63
55
  mn = ScoutApm::Utils::ActiveRecordMetricName.new(sql, name)
64
- assert_equal "User/find", mn.to_s
65
- end
66
-
67
- def test_begin_statement
68
- mn = ScoutApm::Utils::ActiveRecordMetricName.new("BEGIN", nil)
69
- assert_equal "SQL/begin", mn.to_s
70
- end
71
-
72
- def test_commit
73
- mn = ScoutApm::Utils::ActiveRecordMetricName.new("COMMIT", nil)
74
- assert_equal "SQL/commit", mn.to_s
75
- end
76
-
77
-
78
- # Regex test cases, pass these in w/ "SQL" as the AR provided name field
79
- [
80
- ["LoginRecord/save", 'UPDATE "login_record" SET "updated_at" = ? WHERE "login_record"."login_record_id" = ?'],
81
- ["UserAccount/save", 'UPDATE "user_account" SET "last_activity" = ? WHERE "user_account"."user_account_id" = ?'],
82
- ["Membership/save", 'UPDATE "membership" SET "updated_at" = ? WHERE "membership"."membership_id" = ?'],
83
- ["Membership/save", 'UPDATE "membership" SET "updated_by" = ? WHERE "membership"."membership_id" = ?'],
84
- ["Project/find", 'SELECT "project".project_id FROM "project" INNER JOIN "membership" ON "project"."project_id" = "membership"."project_id" WHERE "membership"."user_account_id" = ?'],
85
- ["Entity/count", 'SELECT COUNT(*) FROM "entity" WHERE "entity"."entity_id" IN (?)'],
86
- ["EntityEventStep/find", 'SELECT entity_event_step.entity_id, entity_event_step.event_step_id, event_step.event_id FROM entity_event_step INNER JOIN event_step ON event_step.event_step_id = entity_event_step.event_step_id WHERE event_step.event_id in (?) AND entity_event_step.entity_id in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'],
87
- ["CustomField/count", 'SELECT COUNT(*) FROM "custom_field" WHERE "custom_field"."project_id" = ? AND "custom_field"."enabled" = ?'],
88
- ["Event/find", 'SELECT MAX("events"."updated_at") AS max_id FROM "events" LEFT OUTER JOIN "configurations" ON "configurations"."event_id" = "events"."id" WHERE (configurations.date >= ?)'],
89
- ["Sponsorship/find", ' SELECT "sponsorships"."id" AS t0_r0, "sponsorships"."event_id" AS t0_r1, "sponsorships"."name" AS t0_r2, "sponsorships"."position" AS t0_r3, "sponsorships"."created_at" AS t0_r4, "sponsorships"."updated_at" AS t0_r5, "sponsorships"."display_name" AS t0_r6, "sponsorships"."home_page_id" AS t0_r7, "sponsors"."id" AS t1_r0, "sponsors"."name" AS t1_r1, "sponsors"."url" AS t1_r2, "sponsors"."created_at" AS t1_r3, "sponsors"."updated_at" AS t1_r4, "assets"."id" AS t2_r0, "assets"."type" AS t2_r1, "assets"."assetable_id" AS t2_r2, "assets"."assetable_type" AS t2_r3, "assets"."attachment_file_name" AS t2_r4, "assets"."attachment_content_type" AS t2_r5, "assets"."attachment_file_size" AS t2_r6, "assets"."attachment_updated_at" AS t2_r7, "assets"."created_at" AS t2_r8, "assets"."updated_at" AS t2_r9 FROM "sponsorships" LEFT OUTER JOIN "ranks" ON "ranks"."sponsorship_id" = "sponsorships"."id" LEFT OUTER JOIN "sponsors" ON "sponsors"."id" = "ranks"."sponsor_id" LEFT OUTER JOIN "assets" ON "assets".'],
90
- ["MaxmindGeoliteCountry/find", 'SELECT country, country_code FROM maxmind_geolite_country WHERE start_ip_num <= ? AND ? <= end_ip_num'],
91
- ["Activity/find", 'SELECT `activities`.`id` FROM `activities` INNER JOIN `activity_attendees` ON `activity_attendees`.`activity_id` = `activities`.`id` AND `activity_attendees`.`deleted` = ? LEFT JOIN activity_recurrence_periods arp ON arp.activity_id = activities.id WHERE (activities.updated_at >= ?) AND ((activities.start_date between ? and ? and activities.all_day = ?) or (CAST(activities.start_date as Date) between ? and ? and activities.all_day = ?)) AND (activity_attendees.user_id IN (?)) AND (arp.id IS NULL)'],
92
-
93
- # Lower Case.
94
- # ["MaxmindGeoliteCountry#Select", 'select country, country_code from maxmind_geolite_country where start_ip_num <= ? and ? <= end_ip_num'],
95
-
96
- # No FROM clause (was clipped off)
97
- ["SQL/other", 'SELECT "events"."id" AS t0_r0, "events"."name" AS t0_r1, "events"."subdomain" AS t0_r2, "events"."created_at" AS t0_r3, "events"."updated_at" AS t0_r4, "events"."slug" AS t0_r5, "events"."domain" AS t0_r6, "events"."published" AS t0_r7, "events"."category" AS t0_r8, "events"."venue_id" AS t0_r9, "events"."bitly_url" AS t0_r10, "events"."shown_in_events_list" AS t0_r11, "venues"."id" AS t1_r0, "venues"."name" AS t1_r1, "venues"."capacity" AS t1_r2, "venues"."address" AS t1_r3, "venues"."parking_info" AS t1_r4, "venues"."manual_coordinates" AS t1_r5, "venues"."latitude" AS t1_r6, "venues"."longitude" AS t1_r7, "venues"."description" AS t1_r8, "venues"."created_at" AS t1_r9, "venues"."updated_at" AS t1_r10, "venue_translations"."id" AS t2_r0, "venue_translations"."venue_id" AS t2_r1, "venue_translations"."locale" AS t2_r2, "venue_translations"."created_at" AS t2_r3, "venue_translations"."updated_at" AS t2_r4, "venue_translations"."name" AS t2_r5, "venue_translations"."description" AS t2_r6'],
98
-
99
- # Stuff we don't care about in SQL
100
- ["SQL/other", 'SET SESSION statement_timeout = ?'],
101
- ["SQL/other", 'SHOW TIME ZONE'],
102
-
103
- # Empty strings, or invalid SQL
104
- ["SQL/other", ''],
105
- ["SQL/other", 'not sql at all!'],
106
- ].each_with_index do |(expected, sql), i|
107
- define_method :"test_regex_naming_#{i}" do
108
- actual = ScoutApm::Utils::ActiveRecordMetricName.new(sql, "SQL").to_s
109
- assert_equal expected, actual
110
- end
56
+ assert_equal "SQL/other", mn.to_s
111
57
  end
112
58
  end
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require_relative '../../test_helper'
2
2
  require 'scout_apm/utils/backtrace_parser'
3
3
 
4
4
  class BacktraceParserTest < Minitest::Test
@@ -39,11 +39,6 @@ class BacktraceParserTest < Minitest::Test
39
39
  end
40
40
  end
41
41
 
42
- def test_calls_scm_relative_path
43
- ScoutApm::Utils::Scm.expects(:relative_scm_path).at_least_once
44
- assert ScoutApm::Utils::BacktraceParser.new(raw_backtrace, root).call
45
- end
46
-
47
42
  def test_works_on_shorter_backtraces
48
43
  result = ScoutApm::Utils::BacktraceParser.new(raw_backtrace(1), root).call
49
44
 
data/tester.rb ADDED
@@ -0,0 +1,53 @@
1
+ $: << "./lib"
2
+
3
+ require 'scout_apm'
4
+ require 'stacks'
5
+
6
+ class OneTrace
7
+ attr_reader :data
8
+ attr_reader :num
9
+
10
+ def initialize(num)
11
+ puts "Initialized, expecting #{num}"
12
+ @num = num
13
+ @data = []
14
+ end
15
+
16
+ def add(file, line, label, klass)
17
+ @data << [file, line, label, klass]
18
+ end
19
+ end
20
+
21
+ class GlobalVar
22
+ def self.collect(trace)
23
+ puts "***************************************************************"
24
+
25
+ puts "Collected some data in ruby:\n#{trace.data.map{|x| "#{x[0]}:#{x[1]}\t#{x[3]}##{x[2]}" }.join("\n")}"
26
+ end
27
+ end
28
+
29
+ ####################################
30
+ #
31
+ def quux
32
+ while true
33
+ puts "Hello"
34
+ sleep 0.5
35
+ end
36
+ end
37
+
38
+ class Whipple
39
+ def baz
40
+ quux
41
+ end
42
+ end
43
+
44
+ def bar
45
+ w = Whipple.new
46
+ w.baz
47
+ end
48
+
49
+ def foo
50
+ bar
51
+ end
52
+
53
+ foo
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.6.10
4
+ version: 3.0.0.pre0
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: 2020-10-20 00:00:00.000000000 Z
12
+ date: 2016-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -54,119 +54,7 @@ dependencies:
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
- name: simplecov
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- - !ruby/object:Gem::Dependency
71
- name: rake-compiler
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: '0'
84
- - !ruby/object:Gem::Dependency
85
- name: addressable
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: '0'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: '0'
98
- - !ruby/object:Gem::Dependency
99
- name: activesupport
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: '0'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
- - !ruby/object:Gem::Dependency
113
- name: parser
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :runtime
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
- - !ruby/object:Gem::Dependency
127
- name: activerecord
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- version: '0'
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: '0'
140
- - !ruby/object:Gem::Dependency
141
- name: sqlite3
142
- requirement: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: '0'
147
- type: :development
148
- prerelease: false
149
- version_requirements: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- version: '0'
154
- - !ruby/object:Gem::Dependency
155
- name: rubocop
156
- requirement: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- version: '0'
161
- type: :development
162
- prerelease: false
163
- version_requirements: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - ">="
166
- - !ruby/object:Gem::Version
167
- version: '0'
168
- - !ruby/object:Gem::Dependency
169
- name: guard
57
+ name: m
170
58
  requirement: !ruby/object:Gem::Requirement
171
59
  requirements:
172
60
  - - ">="
@@ -180,7 +68,7 @@ dependencies:
180
68
  - !ruby/object:Gem::Version
181
69
  version: '0'
182
70
  - !ruby/object:Gem::Dependency
183
- name: guard-minitest
71
+ name: simplecov
184
72
  requirement: !ruby/object:Gem::Requirement
185
73
  requirements:
186
74
  - - ">="
@@ -194,7 +82,7 @@ dependencies:
194
82
  - !ruby/object:Gem::Version
195
83
  version: '0'
196
84
  - !ruby/object:Gem::Dependency
197
- name: m
85
+ name: rake-compiler
198
86
  requirement: !ruby/object:Gem::Requirement
199
87
  requirements:
200
88
  - - ">="
@@ -213,15 +101,14 @@ email:
213
101
  executables: []
214
102
  extensions:
215
103
  - ext/allocations/extconf.rb
104
+ - ext/stacks/extconf.rb
216
105
  - ext/rusage/extconf.rb
217
106
  extra_rdoc_files: []
218
107
  files:
219
108
  - ".gitignore"
220
109
  - ".rubocop.yml"
221
- - ".travis.yml"
222
110
  - CHANGELOG.markdown
223
111
  - Gemfile
224
- - Guardfile
225
112
  - LICENSE.md
226
113
  - README.markdown
227
114
  - Rakefile
@@ -231,77 +118,47 @@ files:
231
118
  - ext/rusage/README.md
232
119
  - ext/rusage/extconf.rb
233
120
  - ext/rusage/rusage.c
234
- - gems/README.md
235
- - gems/octoshark.gemfile
236
- - gems/rails3.gemfile
237
- - gems/rails4.gemfile
238
- - gems/rails5.gemfile
239
- - gems/rails6.gemfile
121
+ - ext/stacks/extconf.rb
122
+ - ext/stacks/scout_atomics.h
123
+ - ext/stacks/stacks.c
240
124
  - lib/scout_apm.rb
241
125
  - lib/scout_apm/agent.rb
242
- - lib/scout_apm/agent/exit_handler.rb
243
- - lib/scout_apm/agent/preconditions.rb
244
- - lib/scout_apm/agent_context.rb
126
+ - lib/scout_apm/agent/logging.rb
127
+ - lib/scout_apm/agent/reporting.rb
245
128
  - lib/scout_apm/app_server_load.rb
246
129
  - lib/scout_apm/attribute_arranger.rb
247
- - lib/scout_apm/auto_instrument.rb
248
- - lib/scout_apm/auto_instrument/instruction_sequence.rb
249
- - lib/scout_apm/auto_instrument/layer.rb
250
- - lib/scout_apm/auto_instrument/parser.rb
251
- - lib/scout_apm/auto_instrument/rails.rb
252
130
  - lib/scout_apm/background_job_integrations/delayed_job.rb
253
- - lib/scout_apm/background_job_integrations/legacy_sneakers.rb
254
- - lib/scout_apm/background_job_integrations/que.rb
255
- - lib/scout_apm/background_job_integrations/resque.rb
256
- - lib/scout_apm/background_job_integrations/shoryuken.rb
257
131
  - lib/scout_apm/background_job_integrations/sidekiq.rb
258
- - lib/scout_apm/background_job_integrations/sneakers.rb
259
- - lib/scout_apm/background_recorder.rb
260
132
  - lib/scout_apm/background_worker.rb
261
133
  - lib/scout_apm/bucket_name_splitter.rb
262
134
  - lib/scout_apm/call_set.rb
135
+ - lib/scout_apm/capacity.rb
263
136
  - lib/scout_apm/config.rb
264
137
  - lib/scout_apm/context.rb
265
- - lib/scout_apm/db_query_metric_set.rb
266
- - lib/scout_apm/db_query_metric_stats.rb
267
- - lib/scout_apm/debug.rb
268
- - lib/scout_apm/detailed_trace.rb
138
+ - lib/scout_apm/deploy_integrations/capistrano_2.cap
139
+ - lib/scout_apm/deploy_integrations/capistrano_2.rb
140
+ - lib/scout_apm/deploy_integrations/capistrano_3.cap
141
+ - lib/scout_apm/deploy_integrations/capistrano_3.rb
269
142
  - lib/scout_apm/environment.rb
270
- - lib/scout_apm/error.rb
271
- - lib/scout_apm/error_service.rb
272
- - lib/scout_apm/error_service/error_buffer.rb
273
- - lib/scout_apm/error_service/error_record.rb
274
- - lib/scout_apm/error_service/ignored_exceptions.rb
275
- - lib/scout_apm/error_service/middleware.rb
276
- - lib/scout_apm/error_service/notifier.rb
277
- - lib/scout_apm/error_service/payload.rb
278
- - lib/scout_apm/error_service/periodic_work.rb
279
- - lib/scout_apm/error_service/railtie.rb
280
- - lib/scout_apm/error_service/sidekiq.rb
281
- - lib/scout_apm/extensions/config.rb
282
- - lib/scout_apm/extensions/transaction_callback_payload.rb
283
143
  - lib/scout_apm/fake_store.rb
284
144
  - lib/scout_apm/framework_integrations/rails_2.rb
285
145
  - lib/scout_apm/framework_integrations/rails_3_or_4.rb
286
146
  - lib/scout_apm/framework_integrations/ruby.rb
287
147
  - lib/scout_apm/framework_integrations/sinatra.rb
288
- - lib/scout_apm/git_revision.rb
289
148
  - lib/scout_apm/histogram.rb
290
149
  - lib/scout_apm/ignored_uris.rb
291
150
  - lib/scout_apm/instant/assets/xmlhttp_instrumentation.html
292
151
  - lib/scout_apm/instant/middleware.rb
293
152
  - lib/scout_apm/instant_reporting.rb
294
- - lib/scout_apm/instrument_manager.rb
153
+ - lib/scout_apm/instruments/.DS_Store
295
154
  - lib/scout_apm/instruments/action_controller_rails_2.rb
296
155
  - lib/scout_apm/instruments/action_controller_rails_3_rails4.rb
297
- - lib/scout_apm/instruments/action_view.rb
298
156
  - lib/scout_apm/instruments/active_record.rb
157
+ - lib/scout_apm/instruments/delayed_job.rb
299
158
  - lib/scout_apm/instruments/elasticsearch.rb
300
159
  - lib/scout_apm/instruments/grape.rb
301
- - lib/scout_apm/instruments/http.rb
302
160
  - lib/scout_apm/instruments/http_client.rb
303
161
  - lib/scout_apm/instruments/influxdb.rb
304
- - lib/scout_apm/instruments/memcached.rb
305
162
  - lib/scout_apm/instruments/middleware_detailed.rb
306
163
  - lib/scout_apm/instruments/middleware_summary.rb
307
164
  - lib/scout_apm/instruments/mongoid.rb
@@ -312,51 +169,34 @@ files:
312
169
  - lib/scout_apm/instruments/process/process_memory.rb
313
170
  - lib/scout_apm/instruments/rails_router.rb
314
171
  - lib/scout_apm/instruments/redis.rb
315
- - lib/scout_apm/instruments/resque.rb
316
- - lib/scout_apm/instruments/samplers.rb
317
172
  - lib/scout_apm/instruments/sinatra.rb
318
173
  - lib/scout_apm/job_record.rb
319
174
  - lib/scout_apm/layaway.rb
320
175
  - lib/scout_apm/layaway_file.rb
321
176
  - lib/scout_apm/layer.rb
322
- - lib/scout_apm/layer_children_set.rb
323
177
  - lib/scout_apm/layer_converters/allocation_metric_converter.rb
324
178
  - lib/scout_apm/layer_converters/converter_base.rb
325
- - lib/scout_apm/layer_converters/database_converter.rb
326
179
  - lib/scout_apm/layer_converters/depth_first_walker.rb
327
180
  - lib/scout_apm/layer_converters/error_converter.rb
328
- - lib/scout_apm/layer_converters/find_layer_by_type.rb
329
- - lib/scout_apm/layer_converters/histograms.rb
330
181
  - lib/scout_apm/layer_converters/job_converter.rb
331
182
  - lib/scout_apm/layer_converters/metric_converter.rb
332
183
  - lib/scout_apm/layer_converters/request_queue_time_converter.rb
333
184
  - lib/scout_apm/layer_converters/slow_job_converter.rb
334
185
  - lib/scout_apm/layer_converters/slow_request_converter.rb
335
- - lib/scout_apm/layer_converters/trace_converter.rb
336
- - lib/scout_apm/limited_layer.rb
337
- - lib/scout_apm/logger.rb
338
186
  - lib/scout_apm/metric_meta.rb
339
187
  - lib/scout_apm/metric_set.rb
340
188
  - lib/scout_apm/metric_stats.rb
341
189
  - lib/scout_apm/middleware.rb
342
- - lib/scout_apm/periodic_work.rb
343
190
  - lib/scout_apm/platform_integrations/cloud_foundry.rb
344
191
  - lib/scout_apm/platform_integrations/heroku.rb
345
192
  - lib/scout_apm/platform_integrations/server.rb
346
- - lib/scout_apm/rack.rb
347
- - lib/scout_apm/remote/message.rb
348
- - lib/scout_apm/remote/recorder.rb
349
- - lib/scout_apm/remote/router.rb
350
- - lib/scout_apm/remote/server.rb
351
193
  - lib/scout_apm/reporter.rb
352
- - lib/scout_apm/reporting.rb
353
194
  - lib/scout_apm/request_histograms.rb
354
195
  - lib/scout_apm/request_manager.rb
355
196
  - lib/scout_apm/scored_item_set.rb
356
197
  - lib/scout_apm/serializers/app_server_load_serializer.rb
357
- - lib/scout_apm/serializers/db_query_serializer_to_json.rb
198
+ - lib/scout_apm/serializers/deploy_serializer.rb
358
199
  - lib/scout_apm/serializers/directive_serializer.rb
359
- - lib/scout_apm/serializers/histograms_serializer_to_json.rb
360
200
  - lib/scout_apm/serializers/jobs_serializer_to_json.rb
361
201
  - lib/scout_apm/serializers/metrics_to_json_serializer.rb
362
202
  - lib/scout_apm/serializers/payload_serializer.rb
@@ -375,85 +215,43 @@ files:
375
215
  - lib/scout_apm/slow_transaction.rb
376
216
  - lib/scout_apm/stack_item.rb
377
217
  - lib/scout_apm/store.rb
378
- - lib/scout_apm/synchronous_recorder.rb
379
- - lib/scout_apm/tasks/doctor.rb
380
- - lib/scout_apm/tasks/support.rb
218
+ - lib/scout_apm/trace_compactor.rb
381
219
  - lib/scout_apm/tracer.rb
382
220
  - lib/scout_apm/tracked_request.rb
383
- - lib/scout_apm/transaction.rb
384
- - lib/scout_apm/transaction_time_consumed.rb
385
221
  - lib/scout_apm/utils/active_record_metric_name.rb
386
222
  - lib/scout_apm/utils/backtrace_parser.rb
387
- - lib/scout_apm/utils/gzip_helper.rb
223
+ - lib/scout_apm/utils/fake_stacks.rb
388
224
  - lib/scout_apm/utils/installed_gems.rb
389
225
  - lib/scout_apm/utils/klass_helper.rb
390
- - lib/scout_apm/utils/marshal_logging.rb
391
- - lib/scout_apm/utils/numbers.rb
392
- - lib/scout_apm/utils/scm.rb
226
+ - lib/scout_apm/utils/null_logger.rb
393
227
  - lib/scout_apm/utils/sql_sanitizer.rb
394
228
  - lib/scout_apm/utils/sql_sanitizer_regex.rb
395
229
  - lib/scout_apm/utils/sql_sanitizer_regex_1_8_7.rb
396
230
  - lib/scout_apm/utils/time.rb
397
231
  - lib/scout_apm/utils/unique_id.rb
398
232
  - lib/scout_apm/version.rb
399
- - lib/tasks/doctor.rake
400
233
  - scout_apm.gemspec
401
234
  - test/data/config_test_1.yml
402
235
  - test/test_helper.rb
403
- - test/tmp/README.md
404
- - test/unit/agent_context_test.rb
405
236
  - test/unit/agent_test.rb
406
- - test/unit/auto_instrument/assignments-instrumented.rb
407
- - test/unit/auto_instrument/assignments.rb
408
- - test/unit/auto_instrument/controller-ast.txt
409
- - test/unit/auto_instrument/controller-instrumented.rb
410
- - test/unit/auto_instrument/controller.rb
411
- - test/unit/auto_instrument/rescue_from-instrumented.rb
412
- - test/unit/auto_instrument/rescue_from.rb
413
- - test/unit/auto_instrument_test.rb
414
237
  - test/unit/background_job_integrations/sidekiq_test.rb
415
238
  - test/unit/config_test.rb
416
239
  - test/unit/context_test.rb
417
- - test/unit/db_query_metric_set_test.rb
418
- - test/unit/db_query_metric_stats_test.rb
419
240
  - test/unit/environment_test.rb
420
- - test/unit/error_service/error_buffer_test.rb
421
- - test/unit/error_service/ignored_exceptions_test.rb
422
- - test/unit/extensions/periodic_callbacks_test.rb
423
- - test/unit/extensions/transaction_callbacks_test.rb
424
- - test/unit/fake_store_test.rb
425
- - test/unit/git_revision_test.rb
426
241
  - test/unit/histogram_test.rb
427
242
  - test/unit/ignored_uris_test.rb
428
- - test/unit/instruments/active_record_test.rb
429
- - test/unit/instruments/net_http_test.rb
430
- - test/unit/instruments/percentile_sampler_test.rb
243
+ - test/unit/instruments/active_record_instruments_test.rb
431
244
  - test/unit/layaway_test.rb
432
- - test/unit/layer_children_set_test.rb
433
- - test/unit/layer_converters/depth_first_walker_test.rb
434
- - test/unit/layer_converters/metric_converter_test.rb
435
- - test/unit/layer_converters/stubs.rb
436
- - test/unit/limited_layer_test.rb
437
- - test/unit/logger_test.rb
438
245
  - test/unit/metric_set_test.rb
439
- - test/unit/remote/test_message.rb
440
- - test/unit/remote/test_router.rb
441
- - test/unit/remote/test_server.rb
442
- - test/unit/request_histograms_test.rb
443
246
  - test/unit/scored_item_set_test.rb
444
247
  - test/unit/serializers/payload_serializer_test.rb
445
248
  - test/unit/slow_job_policy_test.rb
446
249
  - test/unit/slow_request_policy_test.rb
447
250
  - test/unit/sql_sanitizer_test.rb
448
251
  - test/unit/store_test.rb
449
- - test/unit/tracer_test.rb
450
- - test/unit/tracked_request_test.rb
451
- - test/unit/transaction_test.rb
452
- - test/unit/transaction_time_consumed_test.rb
453
252
  - test/unit/utils/active_record_metric_name_test.rb
454
253
  - test/unit/utils/backtrace_parser_test.rb
455
- - test/unit/utils/numbers_test.rb
456
- - test/unit/utils/scm.rb
254
+ - tester.rb
457
255
  homepage: https://github.com/scoutapp/scout_apm_ruby
458
256
  licenses:
459
257
  - Proprietary (See LICENSE.md)
@@ -470,11 +268,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
470
268
  version: '0'
471
269
  required_rubygems_version: !ruby/object:Gem::Requirement
472
270
  requirements:
473
- - - ">="
271
+ - - ">"
474
272
  - !ruby/object:Gem::Version
475
- version: '0'
273
+ version: 1.3.1
476
274
  requirements: []
477
- rubygems_version: 3.0.8
275
+ rubyforge_project: scout_apm
276
+ rubygems_version: 2.2.2
478
277
  signing_key:
479
278
  specification_version: 4
480
279
  summary: Ruby application performance monitoring
data/.travis.yml DELETED
@@ -1,26 +0,0 @@
1
- language: ruby
2
- dist: trusty
3
- cache: bundler
4
-
5
- matrix:
6
- include:
7
- - rvm: "1.8.7"
8
- gemfile: gems/rails3.gemfile
9
- - rvm: "1.9.3"
10
- gemfile: gems/rails3.gemfile
11
- - rvm: 2.0
12
- gemfile: gems/rails3.gemfile
13
- - rvm: 2.1
14
- gemfile: gems/rails3.gemfile
15
- - rvm: 2.2
16
- - rvm: 2.3
17
- - rvm: 2.4
18
- - rvm: 2.5
19
- - rvm: 2.6
20
- - rvm: 2.6
21
- gemfile: gems/octoshark.gemfile
22
- - rvm: 2.6
23
- name: rubocop yo
24
- script: bundle exec rubocop
25
- - rvm: 2.6
26
- gemfile: gems/rails3.gemfile
data/Guardfile DELETED
@@ -1,43 +0,0 @@
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