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
@@ -9,71 +9,27 @@ class ConfigPerfTests < Performance::TestCase
9
9
  end
10
10
 
11
11
  def test_raw_access
12
- iterations.times do
12
+ measure do
13
13
  v = @config[:my_value]
14
14
  end
15
15
  end
16
16
 
17
17
  def test_defaulting_access
18
- iterations.times do
18
+ measure do
19
19
  v = @config[:log_level]
20
20
  end
21
21
  end
22
22
 
23
23
  def test_missing_key
24
- iterations.times do
24
+ measure do
25
25
  v = @config[:nope]
26
26
  end
27
27
  end
28
28
 
29
29
  def test_blowing_cache
30
- iterations.times do
30
+ measure do
31
31
  @config.reset_cache
32
32
  v = @config[:my_value]
33
33
  end
34
34
  end
35
-
36
- def test_deep_config_stack_raw_access(timer)
37
- with_deep_config_stack
38
-
39
- timer.measure do
40
- iterations.times do
41
- v = @config[:my_value]
42
- end
43
- end
44
- end
45
-
46
- def test_deep_config_stack_defaulting_access(timer)
47
- with_deep_config_stack
48
-
49
- timer.measure do
50
- iterations.times do
51
- v = @config[:log_level]
52
- end
53
- end
54
- end
55
-
56
- def test_deep_config_stack_across_all_levels(timer)
57
- keys = with_deep_config_stack
58
-
59
- timer.measure do
60
- iterations.times do
61
- keys.each do |key|
62
- v = @config[key]
63
- end
64
- end
65
- end
66
- end
67
-
68
-
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.
73
- keys = (0..100).map {|i| "my_value_#{i}".to_sym}
74
- keys.each do |key|
75
- @config.add_config_for_testing(key => key)
76
- end
77
- keys
78
- end
79
35
  end
@@ -10,67 +10,57 @@ class Marshalling < Performance::TestCase
10
10
  @tt_payload = build_transaction_trace_payload
11
11
  end
12
12
 
13
- def test_basic_marshalling_json(timer)
13
+ def test_basic_marshalling_json
14
14
  with_config(:normalize_json_string_encodings => true) do
15
15
  marshaller = NewRelic::Agent::NewRelicService::JsonMarshaller.new
16
- timer.measure do
17
- (iterations / 100).times do
18
- marshaller.dump(@payload)
19
- marshaller.dump(@tt_payload)
20
- end
16
+ measure do
17
+ marshaller.dump(@payload)
18
+ marshaller.dump(@tt_payload)
21
19
  end
22
20
  end
23
21
  end
24
22
 
25
- def test_json_marshalling_binary_strings(timer)
23
+ def test_json_marshalling_binary_strings
26
24
  with_config(:normalize_json_string_encodings => true) do
27
25
  marshaller = NewRelic::Agent::NewRelicService::JsonMarshaller.new
28
26
  convert_strings_to_binary(@payload)
29
27
  convert_strings_to_binary(@tt_payload)
30
- timer.measure do
31
- (iterations / 100).times do
32
- marshaller.dump(@payload)
33
- marshaller.dump(@tt_payload)
34
- end
28
+ measure do
29
+ marshaller.dump(@payload)
30
+ marshaller.dump(@tt_payload)
35
31
  end
36
32
  end
37
33
  end
38
34
 
39
- def test_json_marshalling_utf16_strings(timer)
35
+ def test_json_marshalling_utf16_strings
40
36
  with_config(:normalize_json_string_encodings => true) do
41
37
  marshaller = NewRelic::Agent::NewRelicService::JsonMarshaller.new
42
38
  convert_strings_to_utf16(@payload)
43
39
  convert_strings_to_utf16(@tt_payload)
44
- timer.measure do
45
- (iterations / 100).times do
46
- marshaller.dump(@payload)
47
- marshaller.dump(@tt_payload)
48
- end
40
+ measure do
41
+ marshaller.dump(@payload)
42
+ marshaller.dump(@tt_payload)
49
43
  end
50
44
  end
51
45
  end
52
46
 
53
- def test_json_marshalling_latin1_strings(timer)
47
+ def test_json_marshalling_latin1_strings
54
48
  with_config(:normalize_json_string_encodings => true) do
55
49
  marshaller = NewRelic::Agent::NewRelicService::JsonMarshaller.new
56
50
  convert_strings_to_latin1(@payload)
57
51
  convert_strings_to_latin1(@tt_payload)
58
- timer.measure do
59
- (iterations / 100).times do
60
- marshaller.dump(@payload)
61
- marshaller.dump(@tt_payload)
62
- end
52
+ measure do
53
+ marshaller.dump(@payload)
54
+ marshaller.dump(@tt_payload)
63
55
  end
64
56
  end
65
57
  end
66
58
 
67
- def test_basic_marshalling_pruby(timer)
59
+ def test_basic_marshalling_pruby
68
60
  marshaller = NewRelic::Agent::NewRelicService::PrubyMarshaller.new
69
- timer.measure do
70
- (iterations / 100).times do
71
- marshaller.dump(@payload)
72
- marshaller.dump(@tt_payload)
73
- end
61
+ measure do
62
+ marshaller.dump(@payload)
63
+ marshaller.dump(@tt_payload)
74
64
  end
75
65
  end
76
66
 
@@ -12,7 +12,7 @@ class QueueTimePerfTests < Performance::TestCase
12
12
  end
13
13
 
14
14
  def test_queue_time_parsing
15
- iterations.times do
15
+ measure do
16
16
  @headers.each do |h|
17
17
  NewRelic::Agent::Instrumentation::QueueTime.parse_frontend_timestamp(h)
18
18
  end
@@ -79,7 +79,7 @@ class RackMiddleware < Performance::TestCase
79
79
  end
80
80
 
81
81
  def test_basic_middleware_stack()
82
- iterations.times do
82
+ measure do
83
83
  @stack.call(@env.dup)
84
84
  end
85
85
  end
@@ -67,7 +67,7 @@ class RumAutoInsertion < Performance::TestCase
67
67
  def run_autoinstrument_source(text)
68
68
  @app.text = text
69
69
  @host.run do
70
- iterations.times do
70
+ measure do
71
71
  browser_monitor.call({})
72
72
  end
73
73
  end
@@ -15,14 +15,14 @@ class SqlObfuscationTests < Performance::TestCase
15
15
  end
16
16
 
17
17
  def test_obfuscate_sql
18
- iterations.times do
18
+ measure do
19
19
  NewRelic::Agent::Database.obfuscate_sql(@long_query)
20
20
  NewRelic::Agent::Database.obfuscate_sql(@short_query)
21
21
  end
22
22
  end
23
23
 
24
24
  def test_obfuscate_sql_postgres
25
- iterations.times do
25
+ measure do
26
26
  NewRelic::Agent::Database.obfuscate_sql(@long_query_pg)
27
27
  NewRelic::Agent::Database.obfuscate_sql(@short_query_pg)
28
28
  end
@@ -4,7 +4,7 @@
4
4
 
5
5
  class StartupShutdown < Performance::TestCase
6
6
  def test_startup_shutdown
7
- (iterations / 100).times do
7
+ measure do
8
8
  NewRelic::Agent.manual_start
9
9
  NewRelic::Agent.shutdown
10
10
  end
@@ -7,28 +7,24 @@ class StatsHashPerfTest < Performance::TestCase
7
7
  @hash = NewRelic::Agent::StatsHash.new
8
8
  end
9
9
 
10
- def test_record(timer)
11
- iterations.times do
10
+ def test_record
11
+ measure do
12
12
  hash = NewRelic::Agent::StatsHash.new
13
- timer.measure do
14
- 100.times do |i|
15
- hash.record("foo#{i}", 1)
16
- end
13
+ 100.times do |i|
14
+ hash.record("foo#{i}", 1)
17
15
  end
18
16
  end
19
17
  end
20
18
 
21
- def test_merge(timer)
22
- iterations.times do
19
+ def test_merge
20
+ measure do
23
21
  incoming = {}
24
22
  100.times do |i|
25
23
  incoming["foo#{i}"] = NewRelic::Agent::Stats.new
26
24
  end
27
25
 
28
26
  hash = NewRelic::Agent::StatsHash.new
29
- timer.measure do
30
- hash.merge!(incoming)
31
- end
27
+ hash.merge!(incoming)
32
28
  end
33
29
  end
34
30
  end
@@ -31,7 +31,7 @@ class ThreadProfiling < Performance::TestCase
31
31
  @threads << Thread.new do
32
32
  @threadq << self
33
33
  transaction_state = NewRelic::Agent::TransactionState.tl_get
34
- def transaction_state.in_request_transaction?; true; end
34
+ def transaction_state.in_web_transaction?; true; end
35
35
  recurse(50, method(:block))
36
36
  end
37
37
  end
@@ -65,51 +65,46 @@ class ThreadProfiling < Performance::TestCase
65
65
  raise e
66
66
  end
67
67
 
68
- def test_gather_backtraces(timer)
68
+ def test_gather_backtraces
69
69
  @service.subscribe(NewRelic::Agent::Threading::BacktraceService::ALL_TRANSACTIONS)
70
- timer.measure do
71
- (iterations / 10).times do
72
- @service.poll
73
- end
70
+ measure do
71
+ @service.poll
74
72
  end
75
73
  @service.unsubscribe(NewRelic::Agent::Threading::BacktraceService::ALL_TRANSACTIONS)
76
74
  end
77
75
 
78
- def test_gather_backtraces_subscribed(timer)
76
+ def test_gather_backtraces_subscribed
79
77
  @service.subscribe('eagle')
80
- timer.measure do
81
- (iterations / 10).times do
82
- t0 = Time.now.to_f
83
- @service.poll
84
- payload = {
85
- :name => 'eagle',
86
- :start_timestamp => t0,
87
- :duration => Time.now.to_f-t0,
88
- :thread => @threads.sample
89
- }
90
- @service.on_transaction_finished(payload)
91
- end
78
+ measure do
79
+ t0 = Time.now.to_f
80
+ @service.poll
81
+ payload = {
82
+ :name => 'eagle',
83
+ :bucket => :request,
84
+ :start_timestamp => t0,
85
+ :duration => Time.now.to_f-t0,
86
+ :thread => @threads.sample
87
+ }
88
+ @service.on_transaction_finished(payload)
92
89
  end
93
90
  @service.unsubscribe('eagle')
94
91
  end
95
92
 
96
- def test_generating_traces(timer)
93
+ def test_generating_traces
97
94
  require 'new_relic/agent/threading/thread_profile'
98
95
 
99
- (iterations/1000).times do
96
+ measure do
100
97
  profile = ::NewRelic::Agent::Threading::ThreadProfile.new({})
101
98
 
102
99
  aggregate_lots_of_nodes(profile, 5, [])
103
100
 
104
- timer.measure do
105
- profile.generate_traces
106
- end
101
+ profile.generate_traces
107
102
  end
108
103
  end
109
104
 
110
105
  def aggregate_lots_of_nodes(profile, depth, trace)
111
106
  if depth > 0
112
- 10.times do |i|
107
+ 7.times do |i|
113
108
  trace.push("path#{i}:#{i+50}:in `depth#{depth}'")
114
109
  aggregate_lots_of_nodes(profile, depth-1, trace)
115
110
  trace.pop
@@ -23,10 +23,10 @@ class TraceExecutionScopedTests < Performance::TestCase
23
23
  end
24
24
 
25
25
  def test_without_callback
26
- iterations.times { @test_class.method_1 }
26
+ measure { @test_class.method_1 }
27
27
  end
28
28
 
29
29
  def test_with_callback
30
- iterations.times { @test_class.method_2 }
30
+ measure { @test_class.method_2 }
31
31
  end
32
32
  end
@@ -60,10 +60,12 @@ class TransactionTracingPerfTests < Performance::TestCase
60
60
  end
61
61
 
62
62
  def test_short_transactions
63
- iterations.times { @dummy.short_transaction }
63
+ measure { @dummy.short_transaction }
64
64
  end
65
65
 
66
66
  def test_long_transactions
67
- @dummy.long_transaction(iterations)
67
+ measure do
68
+ @dummy.long_transaction(10000)
69
+ end
68
70
  end
69
71
  end
data/test/test_helper.rb CHANGED
@@ -35,6 +35,8 @@ class Minitest::Test
35
35
  end
36
36
 
37
37
  def after_teardown
38
+ unfreeze_time
39
+
38
40
  threads = ruby_threads
39
41
  if @__thread_count != threads.count
40
42
  backtraces = threads.map do |thread|
@@ -92,7 +94,9 @@ else
92
94
  end
93
95
  end
94
96
 
95
- require 'agent_helper'
97
+ # This is the public method recommended for plugin developers to share our
98
+ # agent helpers. Use it so we don't accidentally break it.
99
+ NewRelic::Agent.require_test_helper
96
100
 
97
101
  def default_service(stubbed_method_overrides = {})
98
102
  service = stub
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0.279
5
- prerelease:
4
+ version: 3.11.0.283
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jason Clark
@@ -12,41 +11,12 @@ authors:
12
11
  - Ben Weintraub
13
12
  autorequire:
14
13
  bindir: bin
15
- cert_chain:
16
- - !binary |-
17
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURPRENDQWlDZ0F3SUJB
18
- Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREJDTVJFd0R3WURWUVFEREFoelpX
19
- TjEKY21sMGVURVlNQllHQ2dtU0pvbVQ4aXhrQVJrV0NHNWxkM0psYkdsak1S
20
- TXdFUVlLQ1pJbWlaUHlMR1FCR1JZRApZMjl0TUI0WERURTBNREl4TWpJek16
21
- VXpNbG9YRFRFMU1ESXhNakl6TXpVek1sb3dRakVSTUE4R0ExVUVBd3dJCmMy
22
- VmpkWEpwZEhreEdEQVdCZ29Ka2lhSmsvSXNaQUVaRmdodVpYZHlaV3hwWXpF
23
- VE1CRUdDZ21TSm9tVDhpeGsKQVJrV0EyTnZiVENDQVNJd0RRWUpLb1pJaHZj
24
- TkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFOeGFUZkpWcDIyVgpKQ0ZoUVRT
25
- MFp1eW82NlprblV3d29WYmh1U29YSjBtbzlQWlNpZmlJd3I5YUhtTTlkcFN6
26
- dFVhbUR2WGVzTHBQCjhIRVN5aGUzc2dwSzB6N1VYYkRtdFdaWng0M3F1bHgz
27
- eFRPYkxRYXVWWmN4UDhxcUdxdlJ6ZG92cVhuRmU4bE4Kc1JVblhRam05a0Fy
28
- TUk4dUhoY1U3WHZsYlFlVHRQY2pQMFUvWlN5S0FCc0pYUmFtUS9TVkNQWHFB
29
- SFh2K09XUAp0NHlEQi9NckFRRlZTb05pc3lZdEI3QWYvaXpxdzAvY25VQ0FP
30
- WEdRTDI0bDRJcjBkd01kMEs2b0FuYUc5M0RCCnY2eWIzMFZUNWVsdzQwQmVJ
31
- aEJzalpQNzMxdlJnWElsSUtZd2hWQWxrdlJrZXhBeTlrSDQ1NlZ0MGZEQkJZ
32
- a2EKZUU1M0JoZGNndVVDQXdFQUFhTTVNRGN3Q1FZRFZSMFRCQUl3QURBZEJn
33
- TlZIUTRFRmdRVVBKeHYvVkNGZEhPSApsSU5lVjJ4UUdRaEZ0aEV3Q3dZRFZS
34
- MFBCQVFEQWdTd01BMEdDU3FHU0liM0RRRUJCUVVBQTRJQkFRRFJDaVBxCjUw
35
- QjRzSk4wR2oyVCs5Zyt1WHRDODQ1bUpEKzBCbHNBVmpMY2MrVGNoeHhEM0JZ
36
- ZWxuOWMyRXJQU0lyelo5MlEKWWx3THZ3OTlrc0o1UWEvdEFKQ1V5RTN1OUp1
37
- bGRhbGV3UmkvRkhqb0djZGhqVUVyekl5SHRObG5DYlRNZlNjego1VCtyOGlV
38
- aHZ0MHRjWjAvZFExTEZOOHZNaXpONFJtNkpNWHNta0hIeHVvc2xsUTlRMTRz
39
- Q1lkMmVrazJVRjBsCjU5SmQ2aVd4M2lWbVVIU1FOWGlBZEVpaGN3Y3gzZTcx
40
- ZEJOemw2RmlSMzI4UHpuaVVqcmhvU0t6VkxRditKbFIKMWZVeGtvbUtzMkVM
41
- K0ZZTXduQWIrVm1OT2h2MVMrc0poYmpaMzBQS2d6NnZMaFQ2dW5pZUNqTGs5
42
- d0dHbWxTSwpZamJudkE5cXJhTExhalNqCi0tLS0tRU5EIENFUlRJRklDQVRF
43
- LS0tLS0K
44
- date: 2015-02-17 00:00:00.000000000 Z
14
+ cert_chain: []
15
+ date: 2015-03-13 00:00:00.000000000 Z
45
16
  dependencies:
46
17
  - !ruby/object:Gem::Dependency
47
18
  name: rake
48
19
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
20
  requirements:
51
21
  - - '='
52
22
  - !ruby/object:Gem::Version
@@ -54,7 +24,6 @@ dependencies:
54
24
  type: :development
55
25
  prerelease: false
56
26
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
27
  requirements:
59
28
  - - '='
60
29
  - !ruby/object:Gem::Version
@@ -62,151 +31,132 @@ dependencies:
62
31
  - !ruby/object:Gem::Dependency
63
32
  name: minitest
64
33
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
34
  requirements:
67
- - - ~>
35
+ - - "~>"
68
36
  - !ruby/object:Gem::Version
69
37
  version: 4.7.5
70
38
  type: :development
71
39
  prerelease: false
72
40
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
41
  requirements:
75
- - - ~>
42
+ - - "~>"
76
43
  - !ruby/object:Gem::Version
77
44
  version: 4.7.5
78
45
  - !ruby/object:Gem::Dependency
79
46
  name: mocha
80
47
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
48
  requirements:
83
- - - ~>
49
+ - - "~>"
84
50
  - !ruby/object:Gem::Version
85
51
  version: 0.13.0
86
52
  type: :development
87
53
  prerelease: false
88
54
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
55
  requirements:
91
- - - ~>
56
+ - - "~>"
92
57
  - !ruby/object:Gem::Version
93
58
  version: 0.13.0
94
59
  - !ruby/object:Gem::Dependency
95
60
  name: yard
96
61
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
62
  requirements:
99
- - - ! '>='
63
+ - - ">="
100
64
  - !ruby/object:Gem::Version
101
65
  version: '0'
102
66
  type: :development
103
67
  prerelease: false
104
68
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
69
  requirements:
107
- - - ! '>='
70
+ - - ">="
108
71
  - !ruby/object:Gem::Version
109
72
  version: '0'
110
73
  - !ruby/object:Gem::Dependency
111
74
  name: rails
112
75
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
76
  requirements:
115
- - - ~>
77
+ - - "~>"
116
78
  - !ruby/object:Gem::Version
117
79
  version: 3.2.13
118
80
  type: :development
119
81
  prerelease: false
120
82
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
83
  requirements:
123
- - - ~>
84
+ - - "~>"
124
85
  - !ruby/object:Gem::Version
125
86
  version: 3.2.13
126
87
  - !ruby/object:Gem::Dependency
127
88
  name: pry
128
89
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
90
  requirements:
131
- - - ~>
91
+ - - "~>"
132
92
  - !ruby/object:Gem::Version
133
93
  version: 0.9.12
134
94
  type: :development
135
95
  prerelease: false
136
96
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
97
  requirements:
139
- - - ~>
98
+ - - "~>"
140
99
  - !ruby/object:Gem::Version
141
100
  version: 0.9.12
142
101
  - !ruby/object:Gem::Dependency
143
102
  name: hometown
144
103
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
104
  requirements:
147
- - - ~>
105
+ - - "~>"
148
106
  - !ruby/object:Gem::Version
149
107
  version: 0.2.5
150
108
  type: :development
151
109
  prerelease: false
152
110
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
111
  requirements:
155
- - - ~>
112
+ - - "~>"
156
113
  - !ruby/object:Gem::Version
157
114
  version: 0.2.5
158
115
  - !ruby/object:Gem::Dependency
159
116
  name: guard
160
117
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
118
  requirements:
163
- - - ! '>='
119
+ - - ">="
164
120
  - !ruby/object:Gem::Version
165
121
  version: '0'
166
122
  type: :development
167
123
  prerelease: false
168
124
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
125
  requirements:
171
- - - ! '>='
126
+ - - ">="
172
127
  - !ruby/object:Gem::Version
173
128
  version: '0'
174
129
  - !ruby/object:Gem::Dependency
175
130
  name: guard-minitest
176
131
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
132
  requirements:
179
- - - ! '>='
133
+ - - ">="
180
134
  - !ruby/object:Gem::Version
181
135
  version: '0'
182
136
  type: :development
183
137
  prerelease: false
184
138
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
139
  requirements:
187
- - - ! '>='
140
+ - - ">="
188
141
  - !ruby/object:Gem::Version
189
142
  version: '0'
190
143
  - !ruby/object:Gem::Dependency
191
144
  name: rb-fsevent
192
145
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
146
  requirements:
195
- - - ! '>='
147
+ - - ">="
196
148
  - !ruby/object:Gem::Version
197
149
  version: '0'
198
150
  type: :development
199
151
  prerelease: false
200
152
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
153
  requirements:
203
- - - ! '>='
154
+ - - ">="
204
155
  - !ruby/object:Gem::Version
205
156
  version: '0'
206
157
  - !ruby/object:Gem::Dependency
207
158
  name: i18n
208
159
  requirement: !ruby/object:Gem::Requirement
209
- none: false
210
160
  requirements:
211
161
  - - '='
212
162
  - !ruby/object:Gem::Version
@@ -214,7 +164,6 @@ dependencies:
214
164
  type: :development
215
165
  prerelease: false
216
166
  version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
167
  requirements:
219
168
  - - '='
220
169
  - !ruby/object:Gem::Version
@@ -222,32 +171,24 @@ dependencies:
222
171
  - !ruby/object:Gem::Dependency
223
172
  name: sqlite3
224
173
  requirement: !ruby/object:Gem::Requirement
225
- none: false
226
174
  requirements:
227
- - - ! '>='
175
+ - - ">="
228
176
  - !ruby/object:Gem::Version
229
177
  version: '0'
230
178
  type: :development
231
179
  prerelease: false
232
180
  version_requirements: !ruby/object:Gem::Requirement
233
- none: false
234
181
  requirements:
235
- - - ! '>='
182
+ - - ">="
236
183
  - !ruby/object:Gem::Version
237
184
  version: '0'
238
- description: ! 'New Relic is a performance management system, developed by New Relic,
239
-
185
+ description: |
186
+ New Relic is a performance management system, developed by New Relic,
240
187
  Inc (http://www.newrelic.com). New Relic provides you with deep
241
-
242
188
  information about the performance of your web application as it runs
243
-
244
189
  in production. The New Relic Ruby Agent is dual-purposed as a either a
245
-
246
190
  Gem or plugin, hosted on
247
-
248
191
  http://github.com/newrelic/rpm/
249
-
250
- '
251
192
  email: support@newrelic.com
252
193
  executables:
253
194
  - mongrel_rpm
@@ -262,10 +203,10 @@ extra_rdoc_files:
262
203
  - GUIDELINES_FOR_CONTRIBUTING.md
263
204
  - newrelic.yml
264
205
  files:
265
- - .gitignore
266
- - .project
267
- - .travis.yml
268
- - .yardopts
206
+ - ".gitignore"
207
+ - ".project"
208
+ - ".travis.yml"
209
+ - ".yardopts"
269
210
  - CHANGELOG
270
211
  - GUIDELINES_FOR_CONTRIBUTING.md
271
212
  - Gemfile
@@ -280,7 +221,6 @@ files:
280
221
  - cert/cacert.pem
281
222
  - config.dot
282
223
  - config/database.yml
283
- - gem-public_cert.pem
284
224
  - init.rb
285
225
  - install.rb
286
226
  - lib/conditional_vendored_dependency_detection.rb
@@ -314,11 +254,13 @@ files:
314
254
  - lib/new_relic/agent/database/obfuscation_helpers.rb
315
255
  - lib/new_relic/agent/database/obfuscator.rb
316
256
  - lib/new_relic/agent/database/postgres_explain_obfuscator.rb
257
+ - lib/new_relic/agent/datastores.rb
258
+ - lib/new_relic/agent/datastores/metric_helper.rb
317
259
  - lib/new_relic/agent/datastores/mongo.rb
318
- - lib/new_relic/agent/datastores/mongo/metric_generator.rb
319
260
  - lib/new_relic/agent/datastores/mongo/metric_translator.rb
320
261
  - lib/new_relic/agent/datastores/mongo/obfuscator.rb
321
262
  - lib/new_relic/agent/datastores/mongo/statement_formatter.rb
263
+ - lib/new_relic/agent/deprecator.rb
322
264
  - lib/new_relic/agent/error_collector.rb
323
265
  - lib/new_relic/agent/event_buffer.rb
324
266
  - lib/new_relic/agent/event_listener.rb
@@ -379,6 +321,7 @@ files:
379
321
  - lib/new_relic/agent/instrumentation/resque.rb
380
322
  - lib/new_relic/agent/instrumentation/rubyprof.rb
381
323
  - lib/new_relic/agent/instrumentation/sequel.rb
324
+ - lib/new_relic/agent/instrumentation/sequel_helper.rb
382
325
  - lib/new_relic/agent/instrumentation/sidekiq.rb
383
326
  - lib/new_relic/agent/instrumentation/sinatra.rb
384
327
  - lib/new_relic/agent/instrumentation/sinatra/ignorer.rb
@@ -450,6 +393,7 @@ files:
450
393
  - lib/new_relic/agent/vm/rubinius_vm.rb
451
394
  - lib/new_relic/agent/vm/snapshot.rb
452
395
  - lib/new_relic/agent/worker_loop.rb
396
+ - lib/new_relic/build.rb
453
397
  - lib/new_relic/cli/command.rb
454
398
  - lib/new_relic/cli/commands/deployments.rb
455
399
  - lib/new_relic/cli/commands/install.rb
@@ -929,6 +873,11 @@ files:
929
873
  - test/multiverse/suites/marshalling/Envfile
930
874
  - test/multiverse/suites/marshalling/config/newrelic.yml
931
875
  - test/multiverse/suites/marshalling/marshalling_test.rb
876
+ - test/multiverse/suites/memcached/Envfile
877
+ - test/multiverse/suites/memcached/dalli_test.rb
878
+ - test/multiverse/suites/memcached/memcache_client_test.rb
879
+ - test/multiverse/suites/memcached/memcache_test_cases.rb
880
+ - test/multiverse/suites/memcached/memcached_test.rb
932
881
  - test/multiverse/suites/mongo/Envfile
933
882
  - test/multiverse/suites/mongo/config/newrelic.yml
934
883
  - test/multiverse/suites/mongo/helpers/mongo_operation_tests.rb
@@ -997,7 +946,9 @@ files:
997
946
  - test/multiverse/suites/sequel/Envfile
998
947
  - test/multiverse/suites/sequel/config/newrelic.yml
999
948
  - test/multiverse/suites/sequel/database.rb
1000
- - test/multiverse/suites/sequel/sequel_instrumentation_test.rb
949
+ - test/multiverse/suites/sequel/sequel_extension_test.rb
950
+ - test/multiverse/suites/sequel/sequel_helpers.rb
951
+ - test/multiverse/suites/sequel/sequel_plugin_test.rb
1001
952
  - test/multiverse/suites/sequel/sequel_safety_test.rb
1002
953
  - test/multiverse/suites/sidekiq/Envfile
1003
954
  - test/multiverse/suites/sidekiq/after_suite.rb
@@ -1066,10 +1017,12 @@ files:
1066
1017
  - test/new_relic/agent/database/postgres_explain_obfuscator_test.rb
1067
1018
  - test/new_relic/agent/database/sql_obfuscation_test.rb
1068
1019
  - test/new_relic/agent/database_test.rb
1069
- - test/new_relic/agent/datastores/mongo/metric_generator_test.rb
1020
+ - test/new_relic/agent/datastores/metric_helper_test.rb
1070
1021
  - test/new_relic/agent/datastores/mongo/metric_translator_test.rb
1071
1022
  - test/new_relic/agent/datastores/mongo/obfuscator_test.rb
1072
1023
  - test/new_relic/agent/datastores/mongo/statement_formatter_test.rb
1024
+ - test/new_relic/agent/datastores_test.rb
1025
+ - test/new_relic/agent/deprecator_test.rb
1073
1026
  - test/new_relic/agent/error_collector/notice_error_test.rb
1074
1027
  - test/new_relic/agent/error_collector_test.rb
1075
1028
  - test/new_relic/agent/event_buffer_test_cases.rb
@@ -1092,11 +1045,11 @@ files:
1092
1045
  - test/new_relic/agent/instrumentation/net_instrumentation_test.rb
1093
1046
  - test/new_relic/agent/instrumentation/queue_time_test.rb
1094
1047
  - test/new_relic/agent/instrumentation/rack_test.rb
1048
+ - test/new_relic/agent/instrumentation/sequel_helper_test.rb
1095
1049
  - test/new_relic/agent/instrumentation/sinatra/transaction_namer_test.rb
1096
1050
  - test/new_relic/agent/instrumentation/sinatra_test.rb
1097
1051
  - test/new_relic/agent/instrumentation/task_instrumentation_test.rb
1098
1052
  - test/new_relic/agent/javascript_instrumentor_test.rb
1099
- - test/new_relic/agent/memcache_instrumentation_test.rb
1100
1053
  - test/new_relic/agent/memory_logger_test.rb
1101
1054
  - test/new_relic/agent/method_interrobang_test.rb
1102
1055
  - test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb
@@ -1212,6 +1165,7 @@ files:
1212
1165
  - test/performance/lib/performance/baseline_compare_reporter.rb
1213
1166
  - test/performance/lib/performance/baseline_save_reporter.rb
1214
1167
  - test/performance/lib/performance/console_reporter.rb
1168
+ - test/performance/lib/performance/formatting_helpers.rb
1215
1169
  - test/performance/lib/performance/hako_client.rb
1216
1170
  - test/performance/lib/performance/hako_reporter.rb
1217
1171
  - test/performance/lib/performance/instrumentation/cpu_usage.rb
@@ -1230,6 +1184,7 @@ files:
1230
1184
  - test/performance/script/baselines
1231
1185
  - test/performance/script/mega-runner
1232
1186
  - test/performance/script/runner
1187
+ - test/performance/suites/active_record.rb
1233
1188
  - test/performance/suites/config.rb
1234
1189
  - test/performance/suites/marshalling.rb
1235
1190
  - test/performance/suites/queue_time.rb
@@ -1327,33 +1282,31 @@ files:
1327
1282
  - vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_frontend.rb
1328
1283
  - vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb
1329
1284
  - vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_transaction.rb
1330
- - lib/new_relic/build.rb
1331
1285
  homepage: http://www.github.com/newrelic/rpm
1332
1286
  licenses:
1333
1287
  - New Relic
1334
1288
  - MIT
1335
1289
  - Ruby
1290
+ metadata: {}
1336
1291
  post_install_message:
1337
1292
  rdoc_options: []
1338
1293
  require_paths:
1339
1294
  - lib
1340
1295
  required_ruby_version: !ruby/object:Gem::Requirement
1341
- none: false
1342
1296
  requirements:
1343
- - - ! '>='
1297
+ - - ">="
1344
1298
  - !ruby/object:Gem::Version
1345
1299
  version: 1.8.7
1346
1300
  required_rubygems_version: !ruby/object:Gem::Requirement
1347
- none: false
1348
1301
  requirements:
1349
- - - ! '>'
1302
+ - - ">"
1350
1303
  - !ruby/object:Gem::Version
1351
1304
  version: 1.3.1
1352
1305
  requirements: []
1353
1306
  rubyforge_project:
1354
- rubygems_version: 1.8.23
1307
+ rubygems_version: 2.4.5
1355
1308
  signing_key:
1356
- specification_version: 3
1309
+ specification_version: 4
1357
1310
  summary: New Relic Ruby Agent
1358
1311
  test_files: []
1359
1312
  has_rdoc: