newrelic_rpm 3.10.0.279 → 3.11.0.283

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +61 -0
  3. data/lib/new_relic/agent.rb +14 -8
  4. data/lib/new_relic/agent/agent.rb +43 -28
  5. data/lib/new_relic/agent/agent_logger.rb +21 -20
  6. data/lib/new_relic/agent/configuration/default_source.rb +31 -1
  7. data/lib/new_relic/agent/database.rb +2 -1
  8. data/lib/new_relic/agent/datastores.rb +177 -0
  9. data/lib/new_relic/agent/datastores/metric_helper.rb +85 -0
  10. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +11 -20
  11. data/lib/new_relic/agent/deprecator.rb +18 -0
  12. data/lib/new_relic/agent/instrumentation/active_record.rb +20 -35
  13. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +116 -57
  14. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +11 -20
  15. data/lib/new_relic/agent/instrumentation/data_mapper.rb +104 -172
  16. data/lib/new_relic/agent/instrumentation/memcache.rb +104 -52
  17. data/lib/new_relic/agent/instrumentation/metric_frame.rb +9 -0
  18. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +15 -2
  19. data/lib/new_relic/agent/instrumentation/mongo.rb +5 -18
  20. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +36 -0
  21. data/lib/new_relic/agent/new_relic_service.rb +4 -0
  22. data/lib/new_relic/agent/stats_engine/metric_stats.rb +2 -17
  23. data/lib/new_relic/agent/threading/backtrace_service.rb +28 -5
  24. data/lib/new_relic/agent/transaction.rb +63 -34
  25. data/lib/new_relic/agent/transaction_event_aggregator.rb +0 -4
  26. data/lib/new_relic/agent/transaction_sampler.rb +11 -5
  27. data/lib/new_relic/rack/error_collector.rb +0 -1
  28. data/lib/new_relic/version.rb +1 -1
  29. data/lib/sequel/extensions/newrelic_instrumentation.rb +28 -56
  30. data/lib/sequel/plugins/newrelic_instrumentation.rb +28 -45
  31. data/newrelic_rpm.gemspec +0 -7
  32. data/test/agent_helper.rb +35 -16
  33. data/test/environments/rails31/Gemfile +1 -0
  34. data/test/environments/rails32/Gemfile +1 -0
  35. data/test/helpers/mongo_metric_builder.rb +2 -3
  36. data/test/multiverse/lib/multiverse/output_collector.rb +24 -9
  37. data/test/multiverse/lib/multiverse/suite.rb +5 -0
  38. data/test/multiverse/suites/active_record/Envfile +6 -4
  39. data/test/multiverse/suites/active_record/active_record_test.rb +32 -73
  40. data/test/multiverse/suites/active_record/ar_method_aliasing.rb +0 -1
  41. data/test/multiverse/suites/activemerchant/activemerchant_test.rb +0 -3
  42. data/test/multiverse/suites/agent_only/agent_run_id_handling_test.rb +0 -1
  43. data/test/multiverse/suites/agent_only/audit_log_test.rb +0 -1
  44. data/test/multiverse/suites/agent_only/collector_exception_handling_test.rb +0 -2
  45. data/test/multiverse/suites/agent_only/cross_application_tracing_test.rb +0 -1
  46. data/test/multiverse/suites/agent_only/custom_analytics_events_test.rb +0 -2
  47. data/test/multiverse/suites/agent_only/custom_queue_time_test.rb +0 -1
  48. data/test/multiverse/suites/agent_only/encoding_handling_test.rb +0 -2
  49. data/test/multiverse/suites/agent_only/exclusive_time_test.rb +0 -2
  50. data/test/multiverse/suites/agent_only/harvest_timestamps_test.rb +0 -1
  51. data/test/multiverse/suites/agent_only/http_response_code_test.rb +0 -1
  52. data/test/multiverse/suites/agent_only/keepalive_test.rb +0 -1
  53. data/test/multiverse/suites/agent_only/key_transactions_test.rb +54 -9
  54. data/test/multiverse/suites/agent_only/labels_test.rb +0 -2
  55. data/test/multiverse/suites/agent_only/logging_test.rb +0 -1
  56. data/test/multiverse/suites/agent_only/marshaling_test.rb +0 -1
  57. data/test/multiverse/suites/agent_only/pipe_manager_test.rb +0 -2
  58. data/test/multiverse/suites/agent_only/rename_rule_test.rb +5 -7
  59. data/test/multiverse/suites/agent_only/rum_instrumentation_test.rb +0 -1
  60. data/test/multiverse/suites/agent_only/set_transaction_name_test.rb +0 -2
  61. data/test/multiverse/suites/agent_only/ssl_test.rb +0 -2
  62. data/test/multiverse/suites/agent_only/synthetics_test.rb +0 -1
  63. data/test/multiverse/suites/agent_only/testing_app.rb +21 -0
  64. data/test/multiverse/suites/agent_only/thread_profiling_test.rb +1 -2
  65. data/test/multiverse/suites/agent_only/transaction_ignoring_test.rb +0 -2
  66. data/test/multiverse/suites/agent_only/utilization_data_collection_test.rb +0 -1
  67. data/test/multiverse/suites/agent_only/xray_sessions_test.rb +69 -34
  68. data/test/multiverse/suites/capistrano/deployment_test.rb +0 -1
  69. data/test/multiverse/suites/capistrano2/deployment_test.rb +0 -1
  70. data/test/multiverse/suites/config_file_loading/config_file_loading_test.rb +0 -2
  71. data/test/multiverse/suites/curb/curb_test.rb +0 -2
  72. data/test/multiverse/suites/datamapper/Envfile +26 -3
  73. data/test/multiverse/suites/datamapper/config/newrelic.yml +1 -0
  74. data/test/multiverse/suites/datamapper/datamapper_test.rb +271 -37
  75. data/test/multiverse/suites/deferred_instrumentation/sinatra_test.rb +0 -1
  76. data/test/multiverse/suites/delayed_job/Envfile +31 -8
  77. data/test/multiverse/suites/delayed_job/delayed_job_sampler_test.rb +0 -3
  78. data/test/multiverse/suites/delayed_job/unsupported_backend_test.rb +0 -3
  79. data/test/multiverse/suites/excon/excon_test.rb +0 -2
  80. data/test/multiverse/suites/grape/grape_test.rb +0 -3
  81. data/test/multiverse/suites/grape/grape_versioning_test.rb +0 -3
  82. data/test/multiverse/suites/grape/unsupported_version_test.rb +0 -3
  83. data/test/multiverse/suites/high_security/high_security_test.rb +0 -1
  84. data/test/multiverse/suites/httpclient/httpclient_test.rb +0 -2
  85. data/test/multiverse/suites/json/json_test.rb +0 -1
  86. data/test/multiverse/suites/marshalling/marshalling_test.rb +0 -1
  87. data/test/multiverse/suites/memcached/Envfile +52 -0
  88. data/test/multiverse/suites/memcached/dalli_test.rb +89 -0
  89. data/test/multiverse/suites/memcached/memcache_client_test.rb +25 -0
  90. data/test/multiverse/suites/memcached/memcache_test_cases.rb +302 -0
  91. data/test/multiverse/suites/memcached/memcached_test.rb +159 -0
  92. data/test/multiverse/suites/mongo/helpers/mongo_operation_tests.rb +26 -17
  93. data/test/multiverse/suites/mongo/mongo_connection_test.rb +0 -1
  94. data/test/multiverse/suites/mongo/mongo_instrumentation_test.rb +0 -1
  95. data/test/multiverse/suites/mongo/mongo_unsupported_version_test.rb +0 -1
  96. data/test/multiverse/suites/net_http/net_http_test.rb +0 -2
  97. data/test/multiverse/suites/padrino/padrino_test.rb +0 -3
  98. data/test/multiverse/suites/rack/http_response_code_test.rb +0 -1
  99. data/test/multiverse/suites/rack/nested_non_rack_app_test.rb +1 -1
  100. data/test/multiverse/suites/rack/rack_auto_instrumentation_test.rb +12 -12
  101. data/test/multiverse/suites/rack/rack_cascade_test.rb +0 -1
  102. data/test/multiverse/suites/rack/rack_env_mutation_test.rb +0 -1
  103. data/test/multiverse/suites/rack/rack_parameter_filtering_test.rb +0 -1
  104. data/test/multiverse/suites/rack/rack_unsupported_version_test.rb +0 -2
  105. data/test/multiverse/suites/rack/url_map_test.rb +3 -2
  106. data/test/multiverse/suites/rails/Envfile +3 -0
  107. data/test/multiverse/suites/rails/activejob_test.rb +0 -1
  108. data/test/multiverse/suites/rails/app.rb +0 -1
  109. data/test/multiverse/suites/rails/parameter_capture_test.rb +13 -0
  110. data/test/multiverse/suites/rails/rails3_app/app_rails3_plus.rb +5 -0
  111. data/test/multiverse/suites/rails/transaction_ignoring_test.rb +0 -2
  112. data/test/multiverse/suites/resque/instrumentation_test.rb +0 -2
  113. data/test/multiverse/suites/resque/resque_marshalling_test.rb +0 -1
  114. data/test/multiverse/suites/sequel/sequel_extension_test.rb +135 -0
  115. data/test/multiverse/suites/sequel/sequel_helpers.rb +62 -0
  116. data/test/multiverse/suites/sequel/sequel_plugin_test.rb +230 -0
  117. data/test/multiverse/suites/sidekiq/sidekiq_instrumentation_test.rb +0 -2
  118. data/test/multiverse/suites/sinatra/ignoring_test.rb +0 -2
  119. data/test/multiverse/suites/sinatra/nested_middleware_test.rb +0 -2
  120. data/test/multiverse/suites/sinatra/sinatra_classic_test.rb +0 -1
  121. data/test/multiverse/suites/sinatra/sinatra_error_tracing_test.rb +0 -2
  122. data/test/multiverse/suites/sinatra/sinatra_metric_explosion_test.rb +14 -12
  123. data/test/multiverse/suites/sinatra/sinatra_modular_test.rb +0 -1
  124. data/test/multiverse/suites/sinatra/sinatra_routes_test.rb +0 -2
  125. data/test/multiverse/suites/sinatra/sinatra_test_cases.rb +0 -2
  126. data/test/multiverse/suites/typhoeus/typhoeus_test.rb +0 -2
  127. data/test/multiverse/suites/yajl/yajl_test.rb +0 -1
  128. data/test/new_relic/agent/agent/start_test.rb +2 -2
  129. data/test/new_relic/agent/agent_logger_test.rb +6 -3
  130. data/test/new_relic/agent/datastores/metric_helper_test.rb +61 -0
  131. data/test/new_relic/agent/datastores/mongo/metric_translator_test.rb +20 -21
  132. data/test/new_relic/agent/datastores_test.rb +195 -0
  133. data/test/new_relic/agent/deprecator_test.rb +52 -0
  134. data/test/new_relic/agent/instrumentation/action_view_subscriber_test.rb +20 -26
  135. data/test/new_relic/agent/instrumentation/active_record_helper_test.rb +58 -53
  136. data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +7 -20
  137. data/test/new_relic/agent/instrumentation/middleware_proxy_test.rb +19 -0
  138. data/test/new_relic/agent/instrumentation/sequel_helper_test.rb +36 -0
  139. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +1 -0
  140. data/test/new_relic/agent/method_tracer_test.rb +3 -4
  141. data/test/new_relic/agent/pipe_channel_manager_test.rb +1 -1
  142. data/test/new_relic/agent/threading/backtrace_service_test.rb +29 -4
  143. data/test/new_relic/agent/transaction_event_aggregator_test.rb +0 -4
  144. data/test/new_relic/agent/transaction_test.rb +100 -2
  145. data/test/new_relic/agent_test.rb +3 -3
  146. data/test/new_relic/http_client_test_cases.rb +0 -1
  147. data/test/new_relic/multiverse_helpers.rb +7 -0
  148. data/test/new_relic/transaction_ignoring_test_cases.rb +0 -2
  149. data/test/new_relic/transaction_sample_test.rb +11 -2
  150. data/test/performance/README.md +37 -17
  151. data/test/performance/lib/performance.rb +1 -0
  152. data/test/performance/lib/performance/baseline_compare_reporter.rb +11 -7
  153. data/test/performance/lib/performance/console_reporter.rb +29 -5
  154. data/test/performance/lib/performance/formatting_helpers.rb +22 -0
  155. data/test/performance/lib/performance/instrumentation/stackprof.rb +11 -1
  156. data/test/performance/lib/performance/result.rb +17 -6
  157. data/test/performance/lib/performance/runner.rb +7 -3
  158. data/test/performance/lib/performance/test_case.rb +89 -21
  159. data/test/performance/script/runner +13 -1
  160. data/test/performance/suites/active_record.rb +47 -0
  161. data/test/performance/suites/config.rb +4 -48
  162. data/test/performance/suites/marshalling.rb +20 -30
  163. data/test/performance/suites/queue_time.rb +1 -1
  164. data/test/performance/suites/rack_middleware.rb +1 -1
  165. data/test/performance/suites/rum_autoinsertion.rb +1 -1
  166. data/test/performance/suites/sql_obfuscation.rb +2 -2
  167. data/test/performance/suites/startup.rb +1 -1
  168. data/test/performance/suites/stats_hash.rb +7 -11
  169. data/test/performance/suites/thread_profiling.rb +20 -25
  170. data/test/performance/suites/trace_execution_scoped.rb +2 -2
  171. data/test/performance/suites/transaction_tracing.rb +4 -2
  172. data/test/test_helper.rb +5 -1
  173. metadata +53 -100
  174. data.tar.gz.sig +0 -0
  175. data/gem-public_cert.pem +0 -20
  176. data/lib/new_relic/agent/datastores/mongo/metric_generator.rb +0 -33
  177. data/test/multiverse/suites/sequel/sequel_instrumentation_test.rb +0 -289
  178. data/test/new_relic/agent/datastores/mongo/metric_generator_test.rb +0 -69
  179. data/test/new_relic/agent/memcache_instrumentation_test.rb +0 -155
  180. metadata.gz.sig +0 -2
@@ -0,0 +1,159 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
+
5
+ require "./memcache_test_cases"
6
+
7
+ if defined?(Memcached)
8
+ class MemcachedTest < Minitest::Test
9
+ include MemcacheTestCases
10
+
11
+ def setup
12
+ @cache = Memcached.new('localhost', :support_cas => true)
13
+ end
14
+
15
+ def test_get_in_web
16
+ if Memcached::VERSION >= '1.8.0'
17
+ key = set_key_for_testcase
18
+
19
+ expected_metrics = expected_web_metrics(:single_get)
20
+
21
+ in_web_transaction("Controller/#{self.class}/action") do
22
+ @cache.get(key)
23
+ end
24
+
25
+ assert_memcache_metrics_recorded expected_metrics
26
+ else
27
+ super
28
+ end
29
+ end
30
+
31
+ def test_get_multi_in_web
32
+ return unless Memcached::VERSION >= '1.8.0'
33
+ key = set_key_for_testcase
34
+
35
+ expected_metrics = expected_web_metrics(:multi_get)
36
+
37
+ in_web_transaction("Controller/#{self.class}/action") do
38
+ @cache.get([key])
39
+ end
40
+
41
+ assert_memcache_metrics_recorded expected_metrics
42
+ end
43
+
44
+ def test_incr_in_web
45
+ # the memcached gem will raise NotFound error if calling incr on a nonexistent key
46
+ # this overrides the test in the shared memcache_test_cases file
47
+ key = set_key_for_testcase(1)
48
+ expected_metrics = expected_web_metrics(:incr)
49
+
50
+ in_web_transaction("Controller/#{self.class}/action") do
51
+ @cache.incr(key, 1)
52
+ end
53
+
54
+ assert_memcache_metrics_recorded expected_metrics
55
+ end
56
+
57
+ def test_decr_in_web
58
+ # the memcached gem will raise NotFound error if calling incr on a nonexistent key
59
+ # this overrides the test in the shared memcache_test_cases file
60
+ key = set_key_for_testcase(1)
61
+ expected_metrics = expected_web_metrics(:decr)
62
+
63
+ in_web_transaction("Controller/#{self.class}/action") do
64
+ @cache.decr(key, 1)
65
+ end
66
+
67
+ assert_memcache_metrics_recorded expected_metrics
68
+ end
69
+
70
+ def test_cas_in_web
71
+ key = set_key_for_testcase(1)
72
+
73
+ if Memcached::VERSION >= '1.8.0'
74
+ expected_metrics = (expected_web_metrics(:single_get) + expected_web_metrics(:single_cas)).uniq
75
+ else
76
+ expected_metrics = expected_web_metrics(:cas)
77
+ end
78
+
79
+ in_web_transaction("Controller/#{self.class}/action") do
80
+ @cache.cas(key) {|val| val += 2}
81
+ end
82
+
83
+ assert_memcache_metrics_recorded expected_metrics
84
+ assert_equal 3, @cache.get(key)
85
+ end
86
+
87
+ def test_get_in_background
88
+ if Memcached::VERSION >= '1.8.0'
89
+ key = set_key_for_testcase
90
+
91
+ expected_metrics = expected_bg_metrics(:single_get)
92
+
93
+ in_background_transaction("OtherTransaction/Background/#{self.class}/bg_task") do
94
+ @cache.get(key)
95
+ end
96
+
97
+ assert_memcache_metrics_recorded expected_metrics
98
+ else
99
+ super
100
+ end
101
+ end
102
+
103
+ def test_get_multi_in_background
104
+ return unless Memcached::VERSION >= '1.8.0'
105
+
106
+ key = set_key_for_testcase
107
+
108
+ expected_metrics = expected_bg_metrics(:multi_get)
109
+
110
+ in_background_transaction("OtherTransaction/Background/#{self.class}/bg_task") do
111
+ @cache.get([key])
112
+ end
113
+
114
+ assert_memcache_metrics_recorded expected_metrics
115
+ end
116
+
117
+ def test_incr_in_background
118
+ # the memcached gem will raise NotFound error if calling incr on a nonexistent key
119
+ # this overrides the test in the shared memcache_test_cases file
120
+ key = set_key_for_testcase(1)
121
+ expected_metrics = expected_bg_metrics(:incr)
122
+
123
+ in_background_transaction("OtherTransaction/Background/#{self.class}/bg_task") do
124
+ @cache.incr(key, 1)
125
+ end
126
+
127
+ assert_memcache_metrics_recorded expected_metrics
128
+ end
129
+
130
+ def test_decr_in_background
131
+ # the memcached gem will raise NotFound error if calling decr on a nonexistent key
132
+ # this overrides the test in the shared memcache_test_cases file
133
+ key = set_key_for_testcase(1)
134
+ expected_metrics = expected_bg_metrics(:decr)
135
+
136
+ in_background_transaction("OtherTransaction/Background/#{self.class}/bg_task") do
137
+ @cache.decr(key, 1)
138
+ end
139
+
140
+ assert_memcache_metrics_recorded expected_metrics
141
+ end
142
+
143
+ def test_cas_in_background
144
+ key = set_key_for_testcase(1)
145
+ if Memcached::VERSION >= '1.8.0'
146
+ expected_metrics = (expected_bg_metrics(:single_get) + expected_bg_metrics(:single_cas)).uniq
147
+ else
148
+ expected_metrics = expected_bg_metrics(:cas)
149
+ end
150
+
151
+ in_background_transaction("OtherTransaction/Background/#{self.class}/bg_task") do
152
+ @cache.cas(key) {|val| val += 2}
153
+ end
154
+
155
+ assert_memcache_metrics_recorded expected_metrics
156
+ assert_equal 3, @cache.get(key)
157
+ end
158
+ end
159
+ end
@@ -151,7 +151,8 @@ module MongoOperationTests
151
151
  metrics = create_index_metrics
152
152
  elsif client_is_1_10_or_later && !server_is_2_6_or_later?
153
153
  metrics = create_index_metrics.merge(create_indexes_metrics)
154
- metrics['ActiveRecord/all'][:call_count] += 1
154
+ metrics['Datastore/MongoDB/allWeb'][:call_count] += 1
155
+ metrics['Datastore/MongoDB/all'][:call_count] += 1
155
156
  metrics['Datastore/allWeb'][:call_count] += 1
156
157
  metrics['Datastore/all'][:call_count] += 1
157
158
  elsif client_is_1_10_or_later && server_is_2_6_or_later?
@@ -285,6 +286,24 @@ module MongoOperationTests
285
286
  assert_metrics_recorded(expected)
286
287
  end
287
288
 
289
+ def test_web_scoped_metrics
290
+ in_web_transaction("webby") do
291
+ @collection.insert(@tribble)
292
+ end
293
+
294
+ metric = statement_metric(:insert)
295
+ assert_metrics_recorded([[metric, "webby"]])
296
+ end
297
+
298
+ def test_background_scoped_metrics
299
+ in_background_transaction("backed-up") do
300
+ @collection.insert(@tribble)
301
+ end
302
+
303
+ metric = statement_metric(:insert)
304
+ assert_metrics_recorded([[metric, "backed-up"]])
305
+ end
306
+
288
307
  def test_notices_nosql
289
308
  segment = nil
290
309
 
@@ -435,7 +454,7 @@ module MongoOperationTests
435
454
  NewRelic::Agent::Transaction.stubs(:recording_web_transaction?).returns(false)
436
455
  @collection.insert(@tribble)
437
456
 
438
- metrics = build_test_metrics(:insert, :other)
457
+ metrics = build_test_metrics(:insert)
439
458
  expected = metrics_with_attributes(metrics)
440
459
 
441
460
  assert_metrics_recorded(expected)
@@ -448,21 +467,6 @@ module MongoOperationTests
448
467
  assert_metrics_not_recorded(['Datastore/allWeb'])
449
468
  end
450
469
 
451
- def test_insert_records_instance_metric
452
- @collection.insert(@tribble)
453
- assert_metrics_recorded(["Datastore/instance/MongoDB/localhost:#{@client.port}/#{@database_name}"])
454
- end
455
-
456
- def test_save_records_instance_metric
457
- @collection.save(@tribble)
458
- assert_metrics_recorded(["Datastore/instance/MongoDB/localhost:#{@client.port}/#{@database_name}"])
459
- end
460
-
461
- def test_ensure_index_records_instance_metric
462
- @collection.ensure_index([[unique_field_name, Mongo::ASCENDING]])
463
- assert_metrics_recorded(["Datastore/instance/MongoDB/localhost:#{@client.port}/#{@database_name}"])
464
- end
465
-
466
470
  def unique_field_name
467
471
  "field#{SecureRandom.hex(10)}"
468
472
  end
@@ -477,4 +481,9 @@ module MongoOperationTests
477
481
  return false unless client
478
482
  client.respond_to?(:max_wire_version) && client.max_wire_version >= 2
479
483
  end
484
+
485
+ def statement_metric(action)
486
+ metrics = build_test_metrics(action)
487
+ metrics.select { |m| m.start_with?("Datastore/statement") }.first
488
+ end
480
489
  end
@@ -6,7 +6,6 @@ require 'mongo'
6
6
  require 'newrelic_rpm'
7
7
  require 'new_relic/agent/datastores/mongo'
8
8
  require 'securerandom'
9
- require File.join(File.dirname(__FILE__), '..', '..', '..', 'agent_helper')
10
9
 
11
10
  if NewRelic::Agent::Datastores::Mongo.is_supported_version?
12
11
  require File.join(File.dirname(__FILE__), '..', '..', '..', 'helpers', 'mongo_metric_builder')
@@ -6,7 +6,6 @@ require 'mongo'
6
6
  require 'newrelic_rpm'
7
7
  require 'new_relic/agent/datastores/mongo'
8
8
  require 'securerandom'
9
- require File.join(File.dirname(__FILE__), '..', '..', '..', 'agent_helper')
10
9
 
11
10
  if NewRelic::Agent::Datastores::Mongo.is_supported_version?
12
11
  require File.join(File.dirname(__FILE__), '..', '..', '..', 'helpers', 'mongo_metric_builder')
@@ -5,7 +5,6 @@
5
5
  require 'mongo'
6
6
  require 'newrelic_rpm'
7
7
  require 'new_relic/agent/datastores/mongo'
8
- require File.join(File.dirname(__FILE__), '..', '..', '..', 'agent_helper')
9
8
 
10
9
  if !NewRelic::Agent::Datastores::Mongo.is_supported_version?
11
10
  require File.join(File.dirname(__FILE__), 'helpers', 'mongo_server')
@@ -6,8 +6,6 @@ require "net/http"
6
6
  require "newrelic_rpm"
7
7
  require "http_client_test_cases"
8
8
 
9
- require File.join(File.dirname(__FILE__), "..", "..", "..", "agent_helper")
10
-
11
9
  class NetHttpTest < Minitest::Test
12
10
  include HttpClientTestCases
13
11
 
@@ -2,9 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require File.join(File.dirname(__FILE__), '..', '..', '..', 'agent_helper.rb')
6
- require 'multiverse_helpers'
7
-
8
5
  # Shhhh
9
6
  Padrino::Logger::Config[:development][:stream] = :null
10
7
 
@@ -2,7 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'multiverse_helpers'
6
5
  require File.join(File.dirname(__FILE__), 'example_app')
7
6
  require 'new_relic/rack/browser_monitoring'
8
7
  require 'new_relic/rack/agent_hooks'
@@ -2,7 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'multiverse_helpers'
6
5
  require File.join(File.dirname(__FILE__), 'example_app')
7
6
 
8
7
  if NewRelic::Agent::Instrumentation::RackHelpers.rack_version_supported?
@@ -47,6 +46,7 @@ class NestedNonRackAppTest < Minitest::Test
47
46
  assert_metrics_recorded_exclusive(
48
47
  [
49
48
  "Apdex",
49
+ "ApdexAll",
50
50
  "Apdex/NestedNonRackAppTest::RailsishApp/inner",
51
51
  "Controller/NestedNonRackAppTest::RailsishApp/inner",
52
52
  "HttpDispatcher",
@@ -2,7 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'multiverse_helpers'
6
5
  require File.join(File.dirname(__FILE__), 'example_app')
7
6
  require 'new_relic/rack/browser_monitoring'
8
7
  require 'new_relic/rack/agent_hooks'
@@ -58,6 +57,7 @@ class RackAutoInstrumentationTest < Minitest::Test
58
57
  assert_metrics_recorded_exclusive(
59
58
  [
60
59
  "Apdex",
60
+ "ApdexAll",
61
61
  "HttpDispatcher",
62
62
  "Middleware/all",
63
63
  "Apdex/Middleware/Rack/NewRelic::Rack::ErrorCollector/call",
@@ -79,6 +79,7 @@ class RackAutoInstrumentationTest < Minitest::Test
79
79
  assert_metrics_recorded_exclusive(
80
80
  [
81
81
  "Apdex",
82
+ "ApdexAll",
82
83
  "HttpDispatcher",
83
84
  "Middleware/all",
84
85
  "Apdex/Rack/ExampleApp/call",
@@ -101,20 +102,20 @@ class RackAutoInstrumentationTest < Minitest::Test
101
102
  end
102
103
 
103
104
  def test_middlewares_record_queue_time
104
- freeze_time do |t0|
105
- advance_time(5.0)
106
- get '/', {}, { 'HTTP_X_REQUEST_START' => "t=#{t0.to_f}" }
105
+ t0 = freeze_time
106
+ advance_time(5.0)
107
+ get '/', {}, { 'HTTP_X_REQUEST_START' => "t=#{t0.to_f}" }
107
108
 
108
- assert_metrics_recorded(
109
- 'WebFrontend/QueueTime' => { :total_call_time => 5.0 }
110
- )
111
- end
109
+ assert_metrics_recorded(
110
+ 'WebFrontend/QueueTime' => { :total_call_time => 5.0 }
111
+ )
112
112
  end
113
113
 
114
114
  def test_middleware_that_returns_early_records_middleware_rollup_metric
115
115
  get '/?return-early=true'
116
116
  assert_metrics_recorded_exclusive([
117
117
  "Apdex",
118
+ "ApdexAll",
118
119
  "HttpDispatcher",
119
120
  "Middleware/all",
120
121
  "Apdex/Middleware/Rack/MiddlewareTwo/call",
@@ -127,10 +128,9 @@ class RackAutoInstrumentationTest < Minitest::Test
127
128
  end
128
129
 
129
130
  def test_middleware_that_returns_early_middleware_all_has_correct_call_times
130
- freeze_time do
131
- get '/?return-early=true'
132
- assert_metrics_recorded('Middleware/all' => { :total_exclusive_time => 3.0, :call_count => 2 })
133
- end
131
+ freeze_time
132
+ get '/?return-early=true'
133
+ assert_metrics_recorded('Middleware/all' => { :total_exclusive_time => 3.0, :call_count => 2 })
134
134
  end
135
135
 
136
136
  def test_middleware_created_with_args_works
@@ -2,7 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'multiverse_helpers'
6
5
  require File.join(File.dirname(__FILE__), 'example_app')
7
6
  require 'new_relic/rack/browser_monitoring'
8
7
  require 'new_relic/rack/agent_hooks'
@@ -2,7 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'multiverse_helpers'
6
5
  require 'new_relic/rack/browser_monitoring'
7
6
  require 'new_relic/rack/agent_hooks'
8
7
  require 'new_relic/rack/error_collector'
@@ -2,7 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'multiverse_helpers'
6
5
  require 'filtering_test_app'
7
6
 
8
7
  if NewRelic::Agent::Instrumentation::RackHelpers.rack_version_supported?
@@ -2,8 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'multiverse_helpers'
6
-
7
5
  if !NewRelic::Agent::Instrumentation::RackHelpers.rack_version_supported?
8
6
 
9
7
  class RackUnsupportedVersionTest < Minitest::Test
@@ -2,8 +2,6 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
4
 
5
- require 'multiverse_helpers'
6
-
7
5
  if NewRelic::Agent::Instrumentation::RackHelpers.rack_version_supported?
8
6
 
9
7
  class UrlMapTest < Minitest::Test
@@ -64,6 +62,7 @@ class UrlMapTest < Minitest::Test
64
62
 
65
63
  assert_metrics_recorded_exclusive([
66
64
  'Apdex',
65
+ 'ApdexAll',
67
66
  'HttpDispatcher',
68
67
  'Middleware/all',
69
68
  'Controller/Rack/UrlMapTest::ExampleApp/call',
@@ -83,6 +82,7 @@ class UrlMapTest < Minitest::Test
83
82
 
84
83
  assert_metrics_recorded_exclusive([
85
84
  'Apdex',
85
+ 'ApdexAll',
86
86
  'HttpDispatcher',
87
87
  'Middleware/all',
88
88
  'Controller/Rack/UrlMapTest::PrefixAppOne/call',
@@ -101,6 +101,7 @@ class UrlMapTest < Minitest::Test
101
101
 
102
102
  assert_metrics_recorded_exclusive([
103
103
  'Apdex',
104
+ 'ApdexAll',
104
105
  'HttpDispatcher',
105
106
  'Middleware/all',
106
107
  'Controller/Rack/UrlMapTest::PrefixAppTwo/call',
@@ -23,12 +23,14 @@ end
23
23
 
24
24
  gemfile <<-RB
25
25
  gem 'rails', '~>3.2.20'
26
+ gem 'i18n', '~>0.6.11'
26
27
  gem 'haml', '4.0.2' # Getting load issues with haml 4.0.3
27
28
  gem 'minitest_tu_shim', :require => false
28
29
  RB
29
30
 
30
31
  gemfile <<-RB
31
32
  gem 'rails', '~>3.2.20'
33
+ gem 'i18n', '~>0.6.11'
32
34
  gem 'sinatra', '~> 1.4.5'
33
35
  gem 'haml', '4.0.2' # Getting load issues with haml 4.0.3
34
36
  gem 'minitest_tu_shim', :require => false
@@ -36,6 +38,7 @@ RB
36
38
 
37
39
  gemfile <<-RB
38
40
  gem 'rails', '~>3.1.12'
41
+ gem 'i18n', '~>0.6.11'
39
42
  gem 'haml', '4.0.2' # Getting load issues with haml 4.0.3
40
43
  gem 'minitest_tu_shim', :require => false
41
44
  RB