newrelic_rpm 3.8.1.221 → 3.9.0.229

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.gitignore +1 -0
  3. data/.yardopts +2 -0
  4. data/CHANGELOG +95 -0
  5. data/README.md +9 -3
  6. data/Rakefile +6 -0
  7. data/lib/new_relic/agent.rb +37 -52
  8. data/lib/new_relic/agent/agent.rb +32 -64
  9. data/lib/new_relic/agent/agent_logger.rb +3 -2
  10. data/lib/new_relic/agent/audit_logger.rb +2 -1
  11. data/lib/new_relic/agent/busy_calculator.rb +10 -8
  12. data/lib/new_relic/agent/configuration.rb +0 -13
  13. data/lib/new_relic/agent/configuration/default_source.rb +27 -20
  14. data/lib/new_relic/agent/configuration/manager.rb +101 -27
  15. data/lib/new_relic/agent/cross_app_monitor.rb +43 -50
  16. data/lib/new_relic/agent/cross_app_tracing.rb +13 -12
  17. data/lib/new_relic/agent/error_collector.rb +31 -35
  18. data/lib/new_relic/agent/harvester.rb +5 -1
  19. data/lib/new_relic/agent/hostname.rb +17 -0
  20. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -1
  21. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +1 -1
  22. data/lib/new_relic/agent/http_clients/uri_util.rb +13 -0
  23. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +18 -32
  24. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +15 -15
  25. data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
  26. data/lib/new_relic/agent/instrumentation/active_record.rb +6 -4
  27. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +3 -2
  28. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +18 -20
  29. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +79 -93
  30. data/lib/new_relic/agent/instrumentation/curb.rb +3 -3
  31. data/lib/new_relic/agent/instrumentation/data_mapper.rb +5 -4
  32. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +96 -0
  33. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +69 -0
  34. data/lib/new_relic/agent/instrumentation/net.rb +1 -1
  35. data/lib/new_relic/agent/instrumentation/queue_time.rb +21 -13
  36. data/lib/new_relic/agent/instrumentation/rack.rb +85 -74
  37. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +3 -1
  38. data/lib/new_relic/agent/instrumentation/rails_middleware.rb +39 -0
  39. data/lib/new_relic/agent/instrumentation/rubyprof.rb +3 -3
  40. data/lib/new_relic/agent/instrumentation/sidekiq.rb +28 -5
  41. data/lib/new_relic/agent/instrumentation/sinatra.rb +4 -4
  42. data/lib/new_relic/agent/instrumentation/typhoeus.rb +4 -2
  43. data/lib/new_relic/agent/javascript_instrumentor.rb +34 -30
  44. data/lib/new_relic/agent/memory_logger.rb +12 -12
  45. data/lib/new_relic/agent/method_tracer.rb +34 -74
  46. data/lib/new_relic/agent/new_relic_service.rb +1 -1
  47. data/lib/new_relic/agent/pipe_channel_manager.rb +3 -3
  48. data/lib/new_relic/agent/request_sampler.rb +10 -11
  49. data/lib/new_relic/agent/samplers/vm_sampler.rb +6 -6
  50. data/lib/new_relic/agent/shim_agent.rb +2 -1
  51. data/lib/new_relic/agent/sql_sampler.rb +52 -27
  52. data/lib/new_relic/agent/stats.rb +24 -10
  53. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +5 -17
  54. data/lib/new_relic/agent/stats_engine/metric_stats.rb +106 -58
  55. data/lib/new_relic/agent/stats_engine/stats_hash.rb +20 -24
  56. data/lib/new_relic/agent/supported_versions.rb +3 -1
  57. data/lib/new_relic/agent/threading/agent_thread.rb +42 -11
  58. data/lib/new_relic/agent/threading/backtrace_service.rb +3 -7
  59. data/lib/new_relic/agent/threading/thread_profile.rb +2 -2
  60. data/lib/new_relic/agent/traced_method_stack.rb +28 -18
  61. data/lib/new_relic/agent/transaction.rb +249 -196
  62. data/lib/new_relic/agent/transaction_metrics.rb +57 -0
  63. data/lib/new_relic/agent/transaction_sample_builder.rb +10 -7
  64. data/lib/new_relic/agent/transaction_sampler.rb +81 -45
  65. data/lib/new_relic/agent/transaction_state.rb +38 -49
  66. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +15 -18
  67. data/lib/new_relic/agent/vm/rubinius_vm.rb +4 -2
  68. data/lib/new_relic/cli/commands/deployments.rb +3 -2
  69. data/lib/new_relic/control/frameworks/ruby.rb +2 -3
  70. data/lib/new_relic/control/frameworks/sinatra.rb +0 -7
  71. data/lib/new_relic/control/instance_methods.rb +3 -5
  72. data/lib/new_relic/json_wrapper.rb +2 -0
  73. data/lib/new_relic/language_support.rb +1 -1
  74. data/lib/new_relic/local_environment.rb +0 -16
  75. data/lib/new_relic/metric_spec.rb +10 -38
  76. data/lib/new_relic/noticed_error.rb +16 -11
  77. data/lib/new_relic/rack/agent_hooks.rb +4 -10
  78. data/lib/new_relic/rack/agent_middleware.rb +31 -0
  79. data/lib/new_relic/rack/browser_monitoring.rb +7 -13
  80. data/lib/new_relic/rack/developer_mode.rb +16 -59
  81. data/lib/new_relic/rack/error_collector.rb +16 -54
  82. data/lib/new_relic/recipes.rb +8 -101
  83. data/lib/new_relic/recipes/capistrano3.rb +66 -0
  84. data/lib/new_relic/recipes/capistrano_legacy.rb +98 -0
  85. data/lib/new_relic/transaction_sample.rb +6 -54
  86. data/lib/new_relic/transaction_sample/composite_segment.rb +1 -1
  87. data/lib/new_relic/transaction_sample/segment.rb +12 -4
  88. data/lib/new_relic/transaction_sample/summary_segment.rb +1 -1
  89. data/lib/new_relic/version.rb +2 -2
  90. data/lib/newrelic_rpm.rb +1 -1
  91. data/lib/sequel/extensions/newrelic_instrumentation.rb +19 -19
  92. data/lib/tasks/tests.rake +20 -1
  93. data/lib/tasks/versions.html.erb +0 -4
  94. data/lib/tasks/versions.rake +4 -3
  95. data/newrelic.yml +4 -12
  96. data/newrelic_rpm.gemspec +1 -1
  97. data/test/agent_helper.rb +146 -44
  98. data/test/config/newrelic.yml +0 -1
  99. data/test/environments/norails/Gemfile +1 -1
  100. data/test/environments/rails21/Gemfile +1 -1
  101. data/test/environments/rails22/Gemfile +1 -1
  102. data/test/environments/rails23/Gemfile +1 -1
  103. data/test/environments/rails30/Gemfile +1 -1
  104. data/test/environments/rails31/Gemfile +1 -1
  105. data/test/environments/rails32/Gemfile +1 -1
  106. data/test/environments/rails40/Gemfile +1 -1
  107. data/test/environments/rails41/Gemfile +1 -1
  108. data/test/multiverse/lib/multiverse/runner.rb +13 -1
  109. data/test/multiverse/lib/multiverse/suite.rb +26 -9
  110. data/test/multiverse/suites/active_record/config/newrelic.yml +0 -1
  111. data/test/multiverse/suites/activemerchant/Envfile +18 -1
  112. data/test/multiverse/suites/agent_only/audit_log_test.rb +4 -3
  113. data/test/multiverse/suites/agent_only/collector_exception_handling_test.rb +35 -0
  114. data/test/multiverse/suites/agent_only/config/newrelic.yml +0 -1
  115. data/test/multiverse/suites/agent_only/cross_application_tracing_test.rb +1 -0
  116. data/test/multiverse/suites/agent_only/encoding_handling_test.rb +3 -2
  117. data/test/multiverse/suites/agent_only/exclusive_time_test.rb +178 -0
  118. data/test/multiverse/suites/agent_only/logging_test.rb +10 -6
  119. data/test/multiverse/suites/agent_only/marshaling_test.rb +11 -9
  120. data/test/multiverse/suites/agent_only/script/loading.rb +1 -1
  121. data/test/multiverse/suites/agent_only/service_timeout_test.rb +5 -1
  122. data/test/multiverse/suites/agent_only/transaction_ignoring_test.rb +2 -1
  123. data/test/multiverse/suites/agent_only/xray_sessions_test.rb +9 -9
  124. data/test/multiverse/suites/capistrano/Capfile +26 -0
  125. data/test/multiverse/suites/capistrano/Envfile +18 -0
  126. data/test/multiverse/suites/capistrano/config/deploy.rb +10 -0
  127. data/test/multiverse/suites/capistrano/config/deploy/production.rb +9 -0
  128. data/test/multiverse/suites/capistrano/config/newrelic.yml +21 -0
  129. data/test/multiverse/suites/capistrano/deployment_test.rb +47 -0
  130. data/test/multiverse/suites/capistrano2/Capfile +4 -0
  131. data/test/multiverse/suites/capistrano2/Envfile +4 -0
  132. data/test/multiverse/suites/capistrano2/config/deploy.rb +19 -0
  133. data/test/multiverse/suites/capistrano2/config/newrelic.yml +21 -0
  134. data/test/multiverse/suites/capistrano2/deployment_test.rb +38 -0
  135. data/test/multiverse/suites/curb/Envfile +10 -1
  136. data/test/multiverse/suites/curb/config/newrelic.yml +0 -1
  137. data/test/multiverse/suites/datamapper/config/newrelic.yml +0 -1
  138. data/test/multiverse/suites/deferred_instrumentation/config/newrelic.yml +0 -1
  139. data/test/multiverse/suites/excon/config/newrelic.yml +0 -1
  140. data/test/multiverse/suites/httpclient/config/newrelic.yml +0 -1
  141. data/test/multiverse/suites/mongo/config/newrelic.yml +0 -1
  142. data/test/multiverse/suites/net_http/config/newrelic.yml +0 -1
  143. data/test/multiverse/suites/padrino/config/newrelic.yml +0 -1
  144. data/test/multiverse/suites/rack/Envfile +25 -0
  145. data/test/multiverse/suites/rack/example_app.rb +50 -0
  146. data/test/multiverse/suites/rack/nested_non_rack_app_test.rb +66 -0
  147. data/test/multiverse/suites/rack/rack_auto_instrumentation_test.rb +143 -0
  148. data/test/multiverse/suites/rack/rack_unsupported_version_test.rb +45 -0
  149. data/test/multiverse/suites/rack/url_map_test.rb +120 -0
  150. data/test/multiverse/suites/rails/Envfile +10 -0
  151. data/test/multiverse/suites/rails/app.rb +28 -63
  152. data/test/multiverse/suites/rails/bad_instrumentation_test.rb +2 -4
  153. data/test/multiverse/suites/rails/config/newrelic.yml +1 -2
  154. data/test/multiverse/suites/rails/dummy.txt +1 -0
  155. data/test/multiverse/suites/rails/error_tracing_test.rb +46 -31
  156. data/test/multiverse/suites/rails/gc_instrumentation_test.rb +0 -1
  157. data/test/multiverse/suites/rails/ignore_test.rb +9 -3
  158. data/test/multiverse/suites/rails/middleware_instrumentation_test.rb +41 -0
  159. data/test/multiverse/suites/rails/middlewares.rb +19 -0
  160. data/test/multiverse/suites/rails/parameter_capture_test.rb +169 -0
  161. data/test/multiverse/suites/rails/queue_time_test.rb +14 -4
  162. data/test/multiverse/suites/rails/rails2_app/app/controllers/application.rb +7 -0
  163. data/test/multiverse/suites/rails/rails2_app/config/boot.rb +127 -0
  164. data/test/multiverse/suites/rails/rails2_app/config/database.yml +18 -0
  165. data/test/multiverse/suites/rails/rails2_app/config/environment.rb +16 -0
  166. data/test/multiverse/suites/rails/rails2_app/config/environments/development.rb +10 -0
  167. data/test/multiverse/suites/rails/rails2_app/config/initializers/load_newrelic_rpm.rb +9 -0
  168. data/test/multiverse/suites/rails/rails2_app/config/preinitializer.rb +25 -0
  169. data/test/multiverse/suites/rails/rails2_app/config/routes.rb +18 -0
  170. data/test/multiverse/suites/rails/rails2_app/db/schema.rb +5 -0
  171. data/test/multiverse/suites/rails/rails3_app/app_rails3_plus.rb +76 -0
  172. data/test/multiverse/suites/rails/request_statistics_test.rb +2 -4
  173. data/test/multiverse/suites/rails/transaction_ignoring_test.rb +3 -5
  174. data/test/multiverse/suites/rails/view_instrumentation_test.rb +73 -42
  175. data/test/multiverse/suites/resque/config/newrelic.yml +0 -1
  176. data/test/multiverse/suites/sequel/config/newrelic.yml +0 -1
  177. data/test/multiverse/suites/sidekiq/Envfile +4 -0
  178. data/test/multiverse/suites/sidekiq/after_suite.rb +7 -0
  179. data/test/multiverse/suites/sidekiq/config/newrelic.yml +0 -1
  180. data/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +55 -34
  181. data/test/multiverse/suites/sidekiq/sidekiq_server.rb +30 -0
  182. data/test/multiverse/suites/sidekiq/test_worker.rb +60 -0
  183. data/test/multiverse/suites/sinatra/config/newrelic.yml +0 -1
  184. data/test/multiverse/suites/sinatra/ignoring_test.rb +33 -11
  185. data/test/multiverse/suites/sinatra/sinatra_metric_explosion_test.rb +3 -1
  186. data/test/multiverse/suites/typhoeus/Envfile +9 -0
  187. data/test/multiverse/suites/typhoeus/config/newrelic.yml +0 -1
  188. data/test/multiverse/suites/typhoeus/typhoeus_test.rb +10 -0
  189. data/test/multiverse/test/suite_examples/one/a/config/newrelic.yml +0 -1
  190. data/test/multiverse/test/suite_examples/one/b/config/newrelic.yml +0 -1
  191. data/test/new_relic/agent/agent/connect_test.rb +3 -10
  192. data/test/new_relic/agent/agent_logger_test.rb +24 -6
  193. data/test/new_relic/agent/agent_test.rb +7 -8
  194. data/test/new_relic/agent/agent_test_controller.rb +2 -2
  195. data/test/new_relic/agent/audit_logger_test.rb +5 -1
  196. data/test/new_relic/agent/busy_calculator_test.rb +1 -1
  197. data/test/new_relic/agent/configuration/manager_test.rb +68 -69
  198. data/test/new_relic/agent/cross_app_monitor_test.rb +32 -14
  199. data/test/new_relic/agent/cross_app_tracing_test.rb +2 -2
  200. data/test/new_relic/agent/error_collector/notice_error_test.rb +9 -33
  201. data/test/new_relic/agent/error_collector_test.rb +45 -14
  202. data/test/new_relic/agent/harvester_test.rb +9 -0
  203. data/test/new_relic/agent/hostname_test.rb +41 -0
  204. data/test/new_relic/agent/instrumentation/action_controller_subscriber_test.rb +27 -19
  205. data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +1 -1
  206. data/test/new_relic/agent/instrumentation/active_record_test.rb +3 -3
  207. data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +95 -14
  208. data/test/new_relic/agent/instrumentation/middleware_proxy_test.rb +189 -0
  209. data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +2 -2
  210. data/test/new_relic/agent/instrumentation/queue_time_test.rb +18 -1
  211. data/test/new_relic/agent/instrumentation/rack_test.rb +10 -1
  212. data/test/new_relic/agent/instrumentation/sinatra_test.rb +3 -1
  213. data/test/new_relic/agent/javascript_instrumentor_test.rb +28 -41
  214. data/test/new_relic/agent/memory_logger_test.rb +14 -0
  215. data/test/new_relic/agent/method_interrobang_test.rb +1 -1
  216. data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +1 -30
  217. data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +5 -21
  218. data/test/new_relic/agent/method_tracer_test.rb +5 -4
  219. data/test/new_relic/agent/mock_scope_listener.rb +2 -2
  220. data/test/new_relic/agent/obfuscator_test.rb +1 -1
  221. data/test/new_relic/agent/pipe_channel_manager_test.rb +17 -5
  222. data/test/new_relic/agent/request_sampler_test.rb +16 -16
  223. data/test/new_relic/agent/rpm_agent_test.rb +23 -29
  224. data/test/new_relic/agent/sql_sampler_test.rb +39 -31
  225. data/test/new_relic/agent/stats_engine/metric_stats_test.rb +189 -117
  226. data/test/new_relic/agent/stats_engine_test.rb +1 -1
  227. data/test/new_relic/agent/stats_hash_test.rb +28 -1
  228. data/test/new_relic/agent/stats_test.rb +1 -12
  229. data/test/new_relic/agent/threading/agent_thread_test.rb +23 -9
  230. data/test/new_relic/agent/threading/backtrace_service_test.rb +33 -32
  231. data/test/new_relic/agent/threading/fake_thread.rb +4 -8
  232. data/test/new_relic/agent/threading/threaded_test_case.rb +4 -14
  233. data/test/new_relic/agent/traced_method_stack_test.rb +43 -27
  234. data/test/new_relic/agent/transaction_interrobang_test.rb +1 -1
  235. data/test/new_relic/agent/transaction_metrics_test.rb +113 -0
  236. data/test/new_relic/agent/transaction_sample_builder_test.rb +1 -61
  237. data/test/new_relic/agent/transaction_sampler_test.rb +176 -228
  238. data/test/new_relic/agent/transaction_state_test.rb +62 -26
  239. data/test/new_relic/agent/transaction_test.rb +198 -80
  240. data/test/new_relic/agent/vm/monotonic_gc_profiler_test.rb +4 -4
  241. data/test/new_relic/agent/vm/rubinius_vm_test.rb +68 -0
  242. data/test/new_relic/agent_test.rb +31 -27
  243. data/test/new_relic/cli/commands/deployments_test.rb +7 -2
  244. data/test/new_relic/control/instance_methods_test.rb +4 -4
  245. data/test/new_relic/control_test.rb +28 -22
  246. data/test/new_relic/dependency_detection_test.rb +14 -0
  247. data/test/new_relic/fake_external_server.rb +1 -0
  248. data/test/new_relic/fake_rpm_site.rb +35 -0
  249. data/test/new_relic/http_client_test_cases.rb +12 -3
  250. data/test/new_relic/json_wrapper_test.rb +5 -0
  251. data/test/new_relic/language_support_test.rb +7 -0
  252. data/test/new_relic/license_test.rb +11 -5
  253. data/test/new_relic/local_environment_test.rb +0 -18
  254. data/test/new_relic/metric_data_test.rb +2 -2
  255. data/test/new_relic/metric_spec_test.rb +4 -23
  256. data/test/new_relic/multiverse_helpers.rb +1 -3
  257. data/test/new_relic/noticed_error_test.rb +6 -22
  258. data/test/new_relic/rack/agent_hooks_test.rb +5 -1
  259. data/test/new_relic/rack/agent_middleware_test.rb +32 -0
  260. data/test/new_relic/rack/browser_monitoring_test.rb +14 -1
  261. data/test/new_relic/rack/developer_mode_helper_test.rb +0 -8
  262. data/test/new_relic/rack/developer_mode_test.rb +1 -1
  263. data/test/new_relic/rack/error_collector_test.rb +6 -30
  264. data/test/new_relic/transaction_sample/fake_segment_test.rb +2 -2
  265. data/test/new_relic/transaction_sample/segment_test.rb +47 -47
  266. data/test/new_relic/transaction_sample_test.rb +9 -8
  267. data/test/performance/lib/performance/instrumentation/stackprof.rb +11 -8
  268. data/test/performance/script/runner +13 -0
  269. data/test/performance/suites/config.rb +5 -2
  270. data/test/performance/suites/rack_middleware.rb +84 -0
  271. data/test/performance/suites/rum_autoinsertion.rb +1 -1
  272. data/test/performance/suites/thread_profiling.rb +1 -1
  273. data/test/test_helper.rb +12 -10
  274. data/ui/helpers/developer_mode_helper.rb +3 -43
  275. data/ui/views/layouts/newrelic_default.rhtml +2 -2
  276. data/ui/views/newrelic/_sample.rhtml +2 -2
  277. data/ui/views/newrelic/_sql_row.rhtml +11 -11
  278. data/ui/views/newrelic/index.rhtml +21 -22
  279. data/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb +15 -10
  280. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser.rb +2 -0
  281. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/middleware.rb +34 -0
  282. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/nested.rb +24 -0
  283. metadata +108 -31
  284. metadata.gz.sig +0 -0
  285. data/lib/new_relic/rack/transaction_reset.rb +0 -20
  286. data/test/multiverse/suites/rails/mongrel_queue_depth_test.rb +0 -42
  287. data/test/new_relic/rack/transaction_reset_test.rb +0 -35
  288. data/ui/views/newrelic/show_source.rhtml +0 -3
@@ -6,12 +6,12 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_hel
6
6
  require 'new_relic/transaction_sample/fake_segment'
7
7
  class NewRelic::TransactionSample::FakeSegmentTest < Minitest::Test
8
8
  def test_fake_segment_creation
9
- NewRelic::TransactionSample::FakeSegment.new(0.1, 'Custom/test/metric', nil)
9
+ NewRelic::TransactionSample::FakeSegment.new(0.1, 'Custom/test/metric')
10
10
  end
11
11
 
12
12
  def test_parent_segment
13
13
  # should be public in this class, but not in the parent class
14
- s = NewRelic::TransactionSample::FakeSegment.new(0.1, 'Custom/test/metric', nil)
14
+ s = NewRelic::TransactionSample::FakeSegment.new(0.1, 'Custom/test/metric')
15
15
  s.parent_segment = 'foo'
16
16
  assert_equal('foo', s.instance_eval { @parent_segment } )
17
17
  end
@@ -7,13 +7,13 @@ require 'new_relic/transaction_sample/segment'
7
7
  class NewRelic::TransactionSample::SegmentTest < Minitest::Test
8
8
  def test_segment_creation
9
9
  # basic smoke test
10
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
10
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
11
11
  assert_equal NewRelic::TransactionSample::Segment, s.class
12
12
  end
13
13
 
14
14
  def test_readers
15
15
  t = Time.now
16
- s = NewRelic::TransactionSample::Segment.new(t, 'Custom/test/metric', nil)
16
+ s = NewRelic::TransactionSample::Segment.new(t, 'Custom/test/metric')
17
17
  assert_equal(t, s.entry_timestamp)
18
18
  assert_equal(nil, s.exit_timestamp)
19
19
  assert_equal(nil, s.parent_segment)
@@ -22,14 +22,14 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
22
22
  end
23
23
 
24
24
  def test_end_trace
25
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
25
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
26
26
  t = Time.now
27
27
  s.end_trace(t)
28
28
  assert_equal(t, s.exit_timestamp)
29
29
  end
30
30
 
31
31
  def test_add_called_segment
32
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
32
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
33
33
  assert_equal [], s.called_segments
34
34
  fake_segment = mock('segment')
35
35
  fake_segment.expects(:parent_segment=).with(s)
@@ -38,15 +38,15 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
38
38
  end
39
39
 
40
40
  def test_to_s
41
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
41
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
42
42
  s.expects(:to_debug_str).with(0)
43
43
  s.to_s
44
44
  end
45
45
 
46
46
  def test_to_array
47
- parent = NewRelic::TransactionSample::Segment.new(1, 'Custom/test/parent', 1)
47
+ parent = NewRelic::TransactionSample::Segment.new(1, 'Custom/test/parent')
48
48
  parent.params[:test] = 'value'
49
- child = NewRelic::TransactionSample::Segment.new(2, 'Custom/test/child', 2)
49
+ child = NewRelic::TransactionSample::Segment.new(2, 'Custom/test/child')
50
50
  child.end_trace(3)
51
51
  parent.add_called_segment(child)
52
52
  parent.end_trace(4)
@@ -56,7 +56,7 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
56
56
  end
57
57
 
58
58
  def test_to_array_with_bad_values
59
- segment = NewRelic::TransactionSample::Segment.new(nil, nil, nil)
59
+ segment = NewRelic::TransactionSample::Segment.new(nil, nil)
60
60
  segment.end_trace(Rational(10, 1))
61
61
  expected = [0, 10_000.0, "<unknown>", {}, []]
62
62
  assert_equal(expected, segment.to_array)
@@ -64,9 +64,9 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
64
64
 
65
65
  if RUBY_VERSION >= '1.9.2'
66
66
  def test_to_json
67
- parent = NewRelic::TransactionSample::Segment.new(1, 'Custom/test/parent', 1)
67
+ parent = NewRelic::TransactionSample::Segment.new(1, 'Custom/test/parent')
68
68
  parent.params[:test] = 'value'
69
- child = NewRelic::TransactionSample::Segment.new(2, 'Custom/test/child', 2)
69
+ child = NewRelic::TransactionSample::Segment.new(2, 'Custom/test/child')
70
70
  child.end_trace(3)
71
71
  parent.add_called_segment(child)
72
72
  parent.end_trace(4)
@@ -76,7 +76,7 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
76
76
  end
77
77
 
78
78
  def test_path_string
79
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
79
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
80
80
  assert_equal("Custom/test/metric[]", s.path_string)
81
81
 
82
82
  fake_segment = mock('segment')
@@ -89,7 +89,7 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
89
89
  end
90
90
 
91
91
  def test_to_s_compact
92
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
92
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
93
93
  assert_equal("Custom/test/metric", s.to_s_compact)
94
94
 
95
95
  fake_segment = mock('segment')
@@ -101,31 +101,31 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
101
101
  end
102
102
 
103
103
  def test_to_debug_str_basic
104
- s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric', nil)
104
+ s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric')
105
105
  assert_equal(">> 0 ms [Segment] Custom/test/metric \n<< n/a Custom/test/metric\n", s.to_debug_str(0))
106
106
  end
107
107
 
108
108
  def test_to_debug_str_with_params
109
- s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric', nil)
109
+ s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric')
110
110
  s.params = {:whee => 'a param'}
111
111
  assert_equal(">> 0 ms [Segment] Custom/test/metric \n -whee : a param\n<< n/a Custom/test/metric\n", s.to_debug_str(0))
112
112
  end
113
113
 
114
114
  def test_to_debug_str_closed
115
- s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric', nil)
115
+ s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric')
116
116
  s.end_trace(0.1)
117
117
  assert_equal(">> 0 ms [Segment] Custom/test/metric \n<< 100 ms Custom/test/metric\n", s.to_debug_str(0))
118
118
  end
119
119
 
120
120
  def test_to_debug_str_closed_with_nonnumeric
121
- s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric', nil)
121
+ s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric')
122
122
  s.end_trace("0.1")
123
123
  assert_equal(">> 0 ms [Segment] Custom/test/metric \n<< 0.1 Custom/test/metric\n", s.to_debug_str(0))
124
124
  end
125
125
 
126
126
  def test_to_debug_str_one_child
127
- s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric', nil)
128
- s.add_called_segment(NewRelic::TransactionSample::Segment.new(0.1, 'Custom/test/other', nil))
127
+ s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric')
128
+ s.add_called_segment(NewRelic::TransactionSample::Segment.new(0.1, 'Custom/test/other'))
129
129
  assert_equal(">> 0 ms [Segment] Custom/test/metric \n >> 100 ms [Segment] Custom/test/other \n << n/a Custom/test/other\n<< n/a Custom/test/metric\n", s.to_debug_str(0))
130
130
  # try closing it
131
131
  s.called_segments.first.end_trace(0.15)
@@ -134,9 +134,9 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
134
134
  end
135
135
 
136
136
  def test_to_debug_str_multichild
137
- s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric', nil)
138
- s.add_called_segment(NewRelic::TransactionSample::Segment.new(0.1, 'Custom/test/other', nil))
139
- s.add_called_segment(NewRelic::TransactionSample::Segment.new(0.11, 'Custom/test/extra', nil))
137
+ s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric')
138
+ s.add_called_segment(NewRelic::TransactionSample::Segment.new(0.1, 'Custom/test/other'))
139
+ s.add_called_segment(NewRelic::TransactionSample::Segment.new(0.11, 'Custom/test/extra'))
140
140
  assert_equal(">> 0 ms [Segment] Custom/test/metric \n >> 100 ms [Segment] Custom/test/other \n << n/a Custom/test/other\n >> 110 ms [Segment] Custom/test/extra \n << n/a Custom/test/extra\n<< n/a Custom/test/metric\n", s.to_debug_str(0))
141
141
  ending = 0.12
142
142
  s.called_segments.each { |x| x.end_trace(ending += 0.01) }
@@ -145,9 +145,9 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
145
145
  end
146
146
 
147
147
  def test_to_debug_str_nested
148
- inner = NewRelic::TransactionSample::Segment.new(0.2, 'Custom/test/inner', nil)
149
- middle = NewRelic::TransactionSample::Segment.new(0.1, 'Custom/test/middle', nil)
150
- s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric', nil)
148
+ inner = NewRelic::TransactionSample::Segment.new(0.2, 'Custom/test/inner')
149
+ middle = NewRelic::TransactionSample::Segment.new(0.1, 'Custom/test/middle')
150
+ s = NewRelic::TransactionSample::Segment.new(0.0, 'Custom/test/metric')
151
151
  middle.add_called_segment(inner)
152
152
  s.add_called_segment(middle)
153
153
  assert_equal(">> 0 ms [Segment] Custom/test/metric \n >> 100 ms [Segment] Custom/test/middle \n >> 200 ms [Segment] Custom/test/inner \n << n/a Custom/test/inner\n << n/a Custom/test/middle\n<< n/a Custom/test/metric\n", s.to_debug_str(0))
@@ -160,12 +160,12 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
160
160
  end
161
161
 
162
162
  def test_called_segments_default
163
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
163
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
164
164
  assert_equal([], s.called_segments)
165
165
  end
166
166
 
167
167
  def test_called_segments_with_segments
168
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
168
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
169
169
  fake_segment = mock('segment')
170
170
  fake_segment.expects(:parent_segment=).with(s)
171
171
  s.add_called_segment(fake_segment)
@@ -180,19 +180,19 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
180
180
  fake_exit_timestamp.expects(:-).with(fake_entry_timestamp).returns(fake_result)
181
181
  fake_result.expects(:to_f).returns(0.5)
182
182
 
183
- s = NewRelic::TransactionSample::Segment.new(fake_entry_timestamp, 'Custom/test/metric', nil)
183
+ s = NewRelic::TransactionSample::Segment.new(fake_entry_timestamp, 'Custom/test/metric')
184
184
  s.end_trace(fake_exit_timestamp)
185
185
  assert_equal(0.5, s.duration)
186
186
  end
187
187
 
188
188
  def test_exclusive_duration_no_children
189
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
189
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
190
190
  s.expects(:duration).returns(0.5)
191
191
  assert_equal(0.5, s.exclusive_duration)
192
192
  end
193
193
 
194
194
  def test_exclusive_duration_with_children
195
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
195
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
196
196
 
197
197
  s.expects(:duration).returns(0.5)
198
198
 
@@ -206,12 +206,12 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
206
206
  end
207
207
 
208
208
  def test_count_segments_default
209
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
209
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
210
210
  assert_equal(1, s.count_segments)
211
211
  end
212
212
 
213
213
  def test_count_segments_with_children
214
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
214
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
215
215
 
216
216
  fake_segment = mock('segment')
217
217
  fake_segment.expects(:parent_segment=).with(s)
@@ -223,7 +223,7 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
223
223
  end
224
224
 
225
225
  def test_key_equals
226
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
226
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
227
227
  # doing this to hold the reference to the hash
228
228
  params = {}
229
229
  s.params = params
@@ -236,13 +236,13 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
236
236
  end
237
237
 
238
238
  def test_key
239
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
239
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
240
240
  s.params = {:foo => 'correct'}
241
241
  assert_equal('correct', s[:foo])
242
242
  end
243
243
 
244
244
  def test_params
245
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
245
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
246
246
 
247
247
  # should have a default value
248
248
  assert_equal(nil, s.instance_eval { @params })
@@ -254,7 +254,7 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
254
254
  end
255
255
 
256
256
  def test_each_segment_default
257
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
257
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
258
258
  # in the base case it just yields the block to itself
259
259
  count = 0
260
260
  s.each_segment do |x|
@@ -266,7 +266,7 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
266
266
  end
267
267
 
268
268
  def test_each_segment_with_children
269
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
269
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
270
270
 
271
271
  fake_segment = mock('segment')
272
272
  fake_segment.expects(:parent_segment=).with(s)
@@ -283,7 +283,7 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
283
283
  end
284
284
 
285
285
  def test_each_segment_with_nest_tracking
286
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
286
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
287
287
 
288
288
  summary = mock('summary')
289
289
  summary.expects(:current_nest_count).twice.returns(0).then.returns(1)
@@ -294,26 +294,26 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
294
294
  end
295
295
 
296
296
  def test_find_segment_default
297
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
297
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
298
298
  id_to_find = s.segment_id
299
299
  # should return itself in the base case
300
300
  assert_equal(s, s.find_segment(id_to_find))
301
301
  end
302
302
 
303
303
  def test_find_segment_not_found
304
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
304
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
305
305
  assert_equal(nil, s.find_segment(-1))
306
306
  end
307
307
 
308
308
  def test_find_segment_with_children
309
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
309
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
310
310
  id_to_find = s.segment_id
311
311
  # should return itself in the base case
312
312
  assert_equal(s, s.find_segment(id_to_find))
313
313
  end
314
314
 
315
315
  def test_explain_sql_raising_an_error
316
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
316
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
317
317
  config = { :adapter => 'mysql' }
318
318
  statement = NewRelic::Agent::Database::Statement.new('SELECT')
319
319
  statement.config = config
@@ -326,13 +326,13 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
326
326
 
327
327
  def test_explain_sql_can_handle_missing_config
328
328
  # If TT segment came over from Resque child, might not be a Statement
329
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
329
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
330
330
  s.params = { :sql => "SELECT * FROM galaxy" }
331
331
  s.explain_sql
332
332
  end
333
333
 
334
334
  def test_explain_sql_can_use_already_existing_plan
335
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
335
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
336
336
  s.params = {
337
337
  :sql => "SELECT * FROM galaxy",
338
338
  :explain_plan => "EXPLAIN IT!"
@@ -342,7 +342,7 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
342
342
  end
343
343
 
344
344
  def test_params_equal
345
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
345
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
346
346
  assert_equal(nil, s.instance_eval { @params })
347
347
 
348
348
  params = {:foo => 'correct'}
@@ -353,20 +353,20 @@ class NewRelic::TransactionSample::SegmentTest < Minitest::Test
353
353
 
354
354
  def test_obfuscated_sql
355
355
  sql = 'select * from table where id = 1'
356
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
356
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
357
357
  s[:sql] = sql
358
358
  assert_equal('select * from table where id = ?', s.obfuscated_sql)
359
359
  end
360
360
 
361
361
  def test_called_segments_equals
362
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
362
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
363
363
  assert_equal(nil, s.instance_eval { @called_segments })
364
364
  s.called_segments = [1, 2, 3]
365
365
  assert_equal([1, 2, 3], s.instance_eval { @called_segments })
366
366
  end
367
367
 
368
368
  def test_parent_segment_equals
369
- s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric', nil)
369
+ s = NewRelic::TransactionSample::Segment.new(Time.now, 'Custom/test/metric')
370
370
  assert_equal(nil, s.instance_eval { @parent_segment })
371
371
  fake_segment = mock('segment')
372
372
  s.send(:parent_segment=, fake_segment)
@@ -11,7 +11,7 @@ class NewRelic::TransactionSampleTest < Minitest::Test
11
11
 
12
12
  def setup
13
13
  @test_config = { :developer_mode => true }
14
- NewRelic::Agent.config.apply_config(@test_config)
14
+ NewRelic::Agent.config.add_config_for_testing(@test_config)
15
15
 
16
16
  NewRelic::Agent.agent.transaction_sampler.reset!
17
17
 
@@ -221,13 +221,14 @@ class NewRelic::TransactionSampleTest < Minitest::Test
221
221
 
222
222
  def test_count_segments
223
223
  transaction = run_sample_trace do |sampler|
224
- sampler.notice_push_frame "level0"
225
- sampler.notice_push_frame "level-1"
226
- sampler.notice_push_frame "level-2"
227
- sampler.notice_sql(::SQL_STATEMENT, {}, 0)
228
- sampler.notice_pop_frame "level-2"
229
- sampler.notice_pop_frame "level-1"
230
- sampler.notice_pop_frame "level0"
224
+ state = NewRelic::Agent::TransactionState.tl_get
225
+ sampler.notice_push_frame(state, "level0")
226
+ sampler.notice_push_frame(state, "level-1")
227
+ sampler.notice_push_frame(state, "level-2")
228
+ sampler.notice_sql(::SQL_STATEMENT, {}, 0, state)
229
+ sampler.notice_pop_frame(state, "level-2")
230
+ sampler.notice_pop_frame(state, "level-1")
231
+ sampler.notice_pop_frame(state, "level0")
231
232
  end
232
233
 
233
234
  assert_equal 6, transaction.count_segments
@@ -13,20 +13,23 @@ module Performance
13
13
  end
14
14
 
15
15
  def before(test, test_name)
16
- @profile_dir = Dir.mktmpdir('stackprof-profile')
17
- @profile_path = File.join(@profile_dir, "profile.dump")
18
- StackProf.start
16
+ StackProf.start(:mode => :wall)
19
17
  end
20
18
 
21
19
  def after(test, test_name)
22
20
  StackProf.stop
23
- report = StackProf::Report.new(StackProf.results)
24
- output_profile_path = artifact_path(test, test_name, "dot")
25
- File.open(output_profile_path, "w") do |f|
21
+
22
+ output_dump_path = artifact_path(test, test_name, "dump")
23
+ StackProf.results(output_dump_path)
24
+ @artifacts << output_dump_path
25
+
26
+ results = Marshal.load(File.read(output_dump_path))
27
+ output_dot_path = artifact_path(test, test_name, "dot")
28
+ report = StackProf::Report.new(results)
29
+ File.open(output_dot_path, "w") do |f|
26
30
  report.print_graphviz(nil, f)
27
31
  end
28
- @artifacts << output_profile_path
29
- FileUtils.remove_entry_secure(@profile_dir)
32
+ @artifacts << output_dot_path
30
33
  end
31
34
  end
32
35
  end
@@ -22,6 +22,19 @@ parser = OptionParser.new do |opts|
22
22
  opts.on("-i", "--instrumentor=NAME", "Use the named instrumentor") do |name|
23
23
  options[:instrumentors] = [name]
24
24
  end
25
+ opts.on("-P", "--profile", "Do profiling around each test") do
26
+ best_profiling_instrumentor = [
27
+ Performance::Instrumentation::StackProfProfile,
28
+ Performance::Instrumentation::PerfToolsProfile
29
+ ].find(&:supported?)
30
+
31
+ if best_profiling_instrumentor
32
+ options[:inline] = true
33
+ options[:instrumentors] = [best_profiling_instrumentor.to_s]
34
+ else
35
+ Performance.logger.warn("Could not find a supported instrumentor for profiling.")
36
+ end
37
+ end
25
38
  opts.on("-s", "--suite=NAME", "Filter to just run a single test suite") do |name|
26
39
  options[:suite] = name
27
40
  end
@@ -5,7 +5,7 @@
5
5
  class ConfigPerfTests < Performance::TestCase
6
6
  def setup
7
7
  @config = NewRelic::Agent::Configuration::Manager.new
8
- @config.apply_config(:my_value => "boo")
8
+ @config.add_config_for_testing(:my_value => "boo")
9
9
  end
10
10
 
11
11
  def test_raw_access
@@ -67,9 +67,12 @@ class ConfigPerfTests < Performance::TestCase
67
67
 
68
68
 
69
69
  def with_deep_config_stack
70
+ # NOTE: As we have changed the way configs work, this example no longer
71
+ # simulates production code. It would be impossible to have more than
72
+ # 5 levels on the config stack now.
70
73
  keys = (0..100).map {|i| "my_value_#{i}".to_sym}
71
74
  keys.each do |key|
72
- @config.apply_config(key => key)
75
+ @config.add_config_for_testing(key => key)
73
76
  end
74
77
  keys
75
78
  end