newrelic_rpm 3.7.0.174.beta → 3.7.0.177

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +27 -4
  3. data/bin/nrdebug +10 -4
  4. data/lib/new_relic/agent.rb +33 -11
  5. data/lib/new_relic/agent/agent.rb +83 -120
  6. data/lib/new_relic/agent/agent_logger.rb +28 -16
  7. data/lib/new_relic/agent/audit_logger.rb +3 -4
  8. data/lib/new_relic/agent/autostart.rb +20 -8
  9. data/lib/new_relic/agent/commands/agent_command_router.rb +26 -17
  10. data/lib/new_relic/agent/commands/thread_profiler_session.rb +2 -2
  11. data/lib/new_relic/agent/configuration/default_source.rb +146 -59
  12. data/lib/new_relic/agent/configuration/manager.rb +3 -3
  13. data/lib/new_relic/agent/cross_app_monitor.rb +15 -40
  14. data/lib/new_relic/agent/cross_app_tracing.rb +20 -12
  15. data/lib/new_relic/agent/database.rb +24 -0
  16. data/lib/new_relic/agent/error_collector.rb +6 -2
  17. data/lib/new_relic/agent/instrumentation/merb/controller.rb +3 -1
  18. data/lib/new_relic/agent/javascript_instrumentor.rb +187 -0
  19. data/lib/new_relic/agent/new_relic_service.rb +30 -22
  20. data/lib/new_relic/agent/obfuscator.rb +48 -0
  21. data/lib/new_relic/agent/request_sampler.rb +5 -13
  22. data/lib/new_relic/agent/shim_agent.rb +1 -0
  23. data/lib/new_relic/agent/sql_sampler.rb +15 -5
  24. data/lib/new_relic/agent/stats_engine/metric_stats.rb +9 -4
  25. data/lib/new_relic/agent/transaction.rb +0 -1
  26. data/lib/new_relic/agent/transaction_sampler.rb +28 -16
  27. data/lib/new_relic/agent/transaction_state.rb +9 -0
  28. data/lib/new_relic/agent/transaction_timings.rb +5 -1
  29. data/lib/new_relic/agent/worker_loop.rb +0 -10
  30. data/lib/new_relic/cli/deployments.rb +1 -1
  31. data/lib/new_relic/control/instance_methods.rb +1 -1
  32. data/lib/new_relic/helper.rb +3 -1
  33. data/lib/new_relic/rack/browser_monitoring.rb +1 -2
  34. data/lib/new_relic/transaction_sample.rb +11 -13
  35. data/lib/newrelic_rpm.rb +1 -0
  36. data/test/agent_helper.rb +20 -5
  37. data/test/environments/lib/environments/runner.rb +1 -0
  38. data/test/helpers/file_searching.rb +28 -0
  39. data/test/multiverse/lib/multiverse/suite.rb +36 -19
  40. data/test/multiverse/suites/agent_only/collector_exception_handling_test.rb +49 -0
  41. data/test/multiverse/suites/agent_only/http_response_code_test.rb +2 -2
  42. data/test/multiverse/suites/agent_only/rum_instrumentation_test.rb +4 -2
  43. data/test/multiverse/suites/agent_only/service_timeout_test.rb +1 -1
  44. data/test/multiverse/suites/agent_only/set_transaction_name_test.rb +7 -4
  45. data/test/multiverse/suites/agent_only/thread_profiling_test.rb +2 -1
  46. data/test/multiverse/suites/rails/error_tracing_test.rb +34 -4
  47. data/test/multiverse/suites/rails/ignore_test.rb +1 -1
  48. data/test/multiverse/suites/rails/request_statistics_test.rb +1 -3
  49. data/test/multiverse/suites/sequel/sequel_instrumentation_test.rb +10 -7
  50. data/test/multiverse/suites/sinatra/ignoring_test.rb +1 -1
  51. data/test/new_relic/agent/agent/start_worker_thread_test.rb +1 -1
  52. data/test/new_relic/agent/agent_logger_test.rb +108 -114
  53. data/test/new_relic/agent/agent_test.rb +139 -21
  54. data/test/new_relic/agent/audit_logger_test.rb +22 -20
  55. data/test/new_relic/agent/autostart_test.rb +3 -2
  56. data/test/new_relic/agent/commands/agent_command_router_test.rb +51 -32
  57. data/test/new_relic/agent/configuration/default_source_test.rb +8 -2
  58. data/test/new_relic/agent/configuration/manager_test.rb +5 -1
  59. data/test/new_relic/agent/configuration/orphan_configuration_test.rb +57 -0
  60. data/test/new_relic/agent/cross_app_monitor_test.rb +10 -26
  61. data/test/new_relic/agent/database_test.rb +32 -0
  62. data/test/new_relic/agent/error_collector_test.rb +33 -16
  63. data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +88 -71
  64. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +2 -2
  65. data/test/new_relic/agent/javascript_instrumentor_test.rb +341 -0
  66. data/test/new_relic/agent/memcache_instrumentation_test.rb +91 -89
  67. data/test/new_relic/agent/method_tracer_test.rb +1 -1
  68. data/test/new_relic/agent/obfuscator_test.rb +77 -0
  69. data/test/new_relic/agent/pipe_channel_manager_test.rb +5 -5
  70. data/test/new_relic/agent/pipe_service_test.rb +1 -1
  71. data/test/new_relic/agent/request_sampler_test.rb +21 -11
  72. data/test/new_relic/agent/sql_sampler_test.rb +52 -8
  73. data/test/new_relic/agent/stats_engine/metric_stats_test.rb +6 -6
  74. data/test/new_relic/agent/stats_engine_test.rb +18 -2
  75. data/test/new_relic/agent/transaction_sampler_test.rb +98 -53
  76. data/test/new_relic/agent/transaction_state_test.rb +44 -0
  77. data/test/new_relic/agent/transaction_test.rb +1 -1
  78. data/test/new_relic/agent/transaction_timings_test.rb +15 -5
  79. data/test/new_relic/agent/worker_loop_test.rb +0 -9
  80. data/test/new_relic/agent_test.rb +9 -21
  81. data/test/new_relic/data_container_tests.rb +72 -0
  82. data/test/new_relic/fake_collector.rb +69 -20
  83. data/test/new_relic/http_client_test_cases.rb +17 -2
  84. data/test/new_relic/license_test.rb +6 -15
  85. data/test/new_relic/multiverse_helpers.rb +2 -3
  86. data/test/new_relic/rack/browser_monitoring_test.rb +15 -37
  87. data/test/new_relic/transaction_sample_test.rb +92 -62
  88. data/test/performance/suites/rum_autoinsertion.rb +0 -3
  89. data/test/rum/x_ua_meta_tag_spaces_around_equals.result.html +10 -0
  90. data/test/rum/x_ua_meta_tag_spaces_around_equals.source.html +10 -0
  91. data/test/test_helper.rb +9 -5
  92. metadata +29 -11
  93. metadata.gz.sig +0 -0
  94. data/lib/new_relic/agent/beacon_configuration.rb +0 -37
  95. data/lib/new_relic/agent/browser_monitoring.rb +0 -257
  96. data/test/new_relic/agent/beacon_configuration_test.rb +0 -44
  97. data/test/new_relic/agent/browser_monitoring_test.rb +0 -474
@@ -10,20 +10,12 @@ require 'new_relic/rack/browser_monitoring'
10
10
 
11
11
  ENV['RACK_ENV'] = 'test'
12
12
 
13
- # we should expand the environments we support, any rack app could
14
- # benefit from auto-rum, but the truth of the matter is that atm
15
- # we only support Rails >= 2.3
16
- def middleware_supported?
17
- defined?(::Rails) && ::Rails::VERSION::STRING >= '2.3'
18
- end
19
-
20
- if middleware_supported?
21
13
  class BrowserMonitoringTest < Test::Unit::TestCase
22
14
  include Rack::Test::Methods
23
15
 
24
16
  class TestApp
25
- @@next_response = nil
26
17
  @@doc = nil
18
+ @@next_response = nil
27
19
 
28
20
  def self.doc=(other)
29
21
  @@doc = other
@@ -33,6 +25,10 @@ class BrowserMonitoringTest < Test::Unit::TestCase
33
25
  @@next_response = next_response
34
26
  end
35
27
 
28
+ def self.next_response
29
+ @@next_response
30
+ end
31
+
36
32
  def call(env)
37
33
  @@doc ||= <<-EOL
38
34
  <html>
@@ -60,26 +56,19 @@ EOL
60
56
 
61
57
  def setup
62
58
  super
63
- clear_cookies
64
59
  @config = {
65
- :browser_key => 'some browser key',
66
- :beacon => 'beacon',
67
60
  :application_id => 5,
61
+ :beacon => 'beacon',
62
+ :browser_key => 'some browser key',
68
63
  :'rum.enabled' => true,
69
- :episodes_file => 'this_is_my_file',
70
64
  :license_key => 'a' * 40,
71
65
  :js_agent_loader => 'loader',
72
66
  }
73
67
  NewRelic::Agent.config.apply_config(@config)
74
-
75
- beacon_config = NewRelic::Agent::BeaconConfiguration.new
76
- NewRelic::Agent.instance.stubs(:beacon_configuration).returns(beacon_config)
77
68
  end
78
69
 
79
70
  def teardown
80
71
  super
81
- clear_cookies
82
- mocha_teardown
83
72
  TestApp.doc = nil
84
73
  NewRelic::Agent.config.remove_config(@config)
85
74
  NewRelic::Agent.agent.transaction_sampler.reset!
@@ -89,10 +78,6 @@ EOL
89
78
  assert NewRelic::Agent.browser_timing_header.size > 0
90
79
  end
91
80
 
92
- def test_make_sure_footer_is_set
93
- assert NewRelic::Agent.browser_timing_footer.size > 0
94
- end
95
-
96
81
  def test_should_only_instrument_successfull_html_requests
97
82
  assert app.should_instrument?({}, 200, {'Content-Type' => 'text/html'})
98
83
  assert !app.should_instrument?({}, 500, {'Content-Type' => 'text/html'})
@@ -118,8 +103,8 @@ EOL
118
103
 
119
104
  source_files = Dir[File.join(File.dirname(__FILE__), "..", "..", "rum", "*.source.html")]
120
105
 
121
- RUM_HEADER = "|||I AM THE RUM HEADER|||"
122
- RUM_FOOTER = "|||I AM THE RUM FOOTER|||"
106
+ RUM_LOADER = "|||I AM THE RUM HEADER|||"
107
+ RUM_CONFIG = "|||I AM THE RUM FOOTER|||"
123
108
 
124
109
  source_files.each do |source_file|
125
110
  source_filename = File.basename(source_file).gsub(".", "_")
@@ -129,8 +114,7 @@ EOL
129
114
 
130
115
  define_method("test_#{source_filename}") do
131
116
  TestApp.doc = source_html
132
- NewRelic::Agent.instance.stubs(:browser_timing_header).returns(RUM_HEADER)
133
- NewRelic::Agent.instance.stubs(:browser_timing_footer).returns(RUM_FOOTER)
117
+ NewRelic::Agent.stubs(:browser_timing_header).returns(RUM_CONFIG + RUM_LOADER)
134
118
 
135
119
  get '/'
136
120
 
@@ -149,9 +133,8 @@ EOL
149
133
  end
150
134
 
151
135
  def test_should_close_response
152
- response = Rack::Response.new("<html/>")
153
- response.expects(:close)
154
- TestApp.next_response = response
136
+ TestApp.next_response = Rack::Response.new("<html/>")
137
+ TestApp.next_response.expects(:close)
155
138
 
156
139
  get '/'
157
140
 
@@ -159,11 +142,9 @@ EOL
159
142
  end
160
143
 
161
144
  def test_should_not_close_if_not_responded_to
162
- response = Rack::Response.new("<html/>")
163
- response.stubs(:respond_to?).with(:close).returns(false)
164
- response.expects(:close).never
165
-
166
- TestApp.next_response = response
145
+ TestApp.next_response = Rack::Response.new("<html/>")
146
+ TestApp.next_response.stubs(:respond_to?).with(:close).returns(false)
147
+ TestApp.next_response.expects(:close).never
167
148
 
168
149
  get '/'
169
150
 
@@ -206,6 +187,3 @@ EOL
206
187
  assert_equal 18, browser_monitoring.calculate_content_length("七転び八起き")
207
188
  end
208
189
  end
209
- else
210
- puts "Skipping tests in #{__FILE__} because Rails is unavailable (or too old)"
211
- end
@@ -33,71 +33,95 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
33
33
  assert_not_nil @t
34
34
  end
35
35
 
36
- def test_prepare_to_send_strips_sql_if_record_sql_omitted
37
- s = @t.prepare_to_send!(:explain_sql => 0.00000001)
38
-
39
- s.each_segment do |segment|
40
- assert_nil segment.params[:explain_plan]
41
- assert_nil segment.params[:sql]
36
+ def test_prepare_to_send_strips_sql_if_record_sql_is_off_or_none_or_false
37
+ record_sql_values = %w(off none false)
38
+ record_sql_values.each do |record_sql_value|
39
+ s = make_sql_transaction(::SQL_STATEMENT, ::SQL_STATEMENT)
40
+ with_config(:'transaction_tracer.record_sql' => record_sql_value) do
41
+ s.prepare_to_send!
42
+ s.each_segment do |segment|
43
+ assert_nil segment.params[:explain_plan]
44
+ assert_nil segment.params[:sql]
45
+ end
46
+ end
42
47
  end
43
48
  end
44
49
 
45
50
  def test_prepare_to_send_preserves_raw_sql_if_record_sql_set_to_raw
46
- s = @t.prepare_to_send!(:record_sql => :raw)
47
-
48
- sql_statements = []
49
- s.each_segment do |segment|
50
- sql_statements << segment.params[:sql] if segment.params[:sql]
51
+ with_config(:'transaction_tracer.record_sql' => 'raw') do
52
+ @t.prepare_to_send!
51
53
  end
52
54
 
55
+ sql_statements = extract_captured_sql(@t)
53
56
  assert_equal([::SQL_STATEMENT], sql_statements)
54
57
  end
55
58
 
56
59
  def test_prepare_to_send_obfuscates_sql_if_record_sql_set_to_obfuscated
57
- s = @t.prepare_to_send!(:record_sql => :obfuscated)
58
-
59
- sql_statements = []
60
- s.each_segment do |segment|
61
- sql_statements << segment.params[:sql] if segment.params[:sql]
60
+ with_config(:'transaction_tracer.record_sql' => 'obfuscated') do
61
+ @t.prepare_to_send!
62
62
  end
63
63
 
64
+ sql_statements = extract_captured_sql(@t)
64
65
  assert_equal([::OBFUSCATED_SQL_STATEMENT], sql_statements)
65
66
  end
66
67
 
67
68
  def test_have_sql_rows_when_sql_is_recorded
68
- s = @t.prepare_to_send!(:explain_sql => 0.00000001)
69
+ with_config(:'transaction_tracer.record_sql' => 'off') do
70
+ @t.prepare_to_send!
71
+ end
69
72
 
70
- assert s.sql_segments.empty?
71
- s.root_segment[:sql] = 'hello'
72
- assert !s.sql_segments.empty?
73
+ assert @t.sql_segments.empty?
74
+ @t.root_segment[:sql] = 'hello'
75
+ assert !@t.sql_segments.empty?
73
76
  end
74
77
 
75
78
  def test_have_sql_rows_when_sql_is_obfuscated
76
- s = @t.prepare_to_send!(:explain_sql => 0.00000001)
79
+ with_config(:'transaction_tracer.record_sql' => 'off') do
80
+ @t.prepare_to_send!
81
+ end
77
82
 
78
- assert s.sql_segments.empty?
79
- s.root_segment[:sql_obfuscated] = 'hello'
80
- assert !s.sql_segments.empty?
83
+ assert @t.sql_segments.empty?
84
+ @t.root_segment[:sql_obfuscated] = 'hello'
85
+ assert !@t.sql_segments.empty?
81
86
  end
82
87
 
83
88
  def test_have_sql_rows_when_recording_non_sql_keys
84
- s = @t.prepare_to_send!(:explain_sql => 0.00000001)
89
+ with_config(:'transaction_tracer.record_sql' => 'off') do
90
+ @t.prepare_to_send!
91
+ end
85
92
 
86
- assert s.sql_segments.empty?
87
- s.root_segment[:key] = 'hello'
88
- assert !s.sql_segments.empty?
93
+ assert @t.sql_segments.empty?
94
+ @t.root_segment[:key] = 'hello'
95
+ assert !@t.sql_segments.empty?
89
96
  end
90
97
 
91
98
  def test_catch_exceptions
99
+ config = {
100
+ :'transaction_tracer.record_sql' => 'obfuscated',
101
+ :'transaction_tracer.explain_enabled' => true,
102
+ :'transaction_tracer.explain_threshold' => 0.00000001
103
+ }
104
+
92
105
  @connection_stub.expects(:execute).raises
93
- # the sql connection will throw
94
- @t.prepare_to_send!(:record_sql => :obfuscated, :explain_sql => 0.00000001)
106
+ with_config(config) do
107
+ assert_nothing_raised do
108
+ @t.prepare_to_send!
109
+ end
110
+ end
95
111
  end
96
112
 
97
113
  def test_have_explains
98
- s = @t.prepare_to_send!(:record_sql => :obfuscated, :explain_sql => 0.00000001)
114
+ config = {
115
+ :'transaction_tracer.record_sql' => 'obfuscated',
116
+ :'transaction_tracer.explain_enabled' => true,
117
+ :'transaction_tracer.explain_threshold' => 0.00000001
118
+ }
119
+
120
+ with_config(config) do
121
+ @t.prepare_to_send!
122
+ end
99
123
 
100
- s.each_segment do |segment|
124
+ @t.each_segment do |segment|
101
125
  if segment.params[:explain_plan]
102
126
  explanation = segment.params[:explain_plan]
103
127
 
@@ -107,20 +131,6 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
107
131
  end
108
132
  end
109
133
 
110
- def test_not_record_sql_without_record_sql_option
111
- t = nil
112
- NewRelic::Agent.disable_sql_recording do
113
- t = make_sql_transaction(::SQL_STATEMENT, ::SQL_STATEMENT)
114
- end
115
-
116
- s = t.prepare_to_send!(:explain_sql => 0.00000001)
117
-
118
- s.each_segment do |segment|
119
- assert_nil segment.params[:explain_plan]
120
- assert_nil segment.params[:sql]
121
- end
122
- end
123
-
124
134
  def test_not_record_transactions
125
135
  NewRelic::Agent.disable_transaction_tracing do
126
136
  t = make_sql_transaction(::SQL_STATEMENT, ::SQL_STATEMENT)
@@ -129,7 +139,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
129
139
  end
130
140
 
131
141
  def test_path_string
132
- s = @t.prepare_to_send!(:explain_sql => 0.1)
142
+ s = @t.prepare_to_send!
133
143
  fake_segment = mock('segment')
134
144
  fake_segment.expects(:path_string).returns('a path string')
135
145
  s.instance_eval do
@@ -140,7 +150,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
140
150
  end
141
151
 
142
152
  def test_params_equals
143
- s = @t.prepare_to_send!(:explain_sql => 0.1)
153
+ s = @t.prepare_to_send!
144
154
  s.params = {:params => 'hash' }
145
155
  assert_equal({:params => 'hash'}, s.params, "should have the specified hash, but instead was #{s.params}")
146
156
  end
@@ -150,22 +160,22 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
150
160
  end
151
161
 
152
162
  def test_to_s_with_bad_object
153
- s = @t.prepare_to_send!(:explain_sql => 0.1)
154
- s.params[:fake] = Hat.new
163
+ @t.prepare_to_send!
164
+ @t.params[:fake] = Hat.new
155
165
  assert_raise(RuntimeError) do
156
- s.to_s
166
+ @t.to_s
157
167
  end
158
168
  end
159
169
 
160
170
  def test_to_s_includes_keys
161
- s = @t.prepare_to_send!(:explain_sql => 0.1)
162
- s.params[:fake_key] = 'a fake param'
163
- assert(s.to_s.include?('fake_key'), "should include 'fake_key' but instead was (#{s.to_s})")
164
- assert(s.to_s.include?('a fake param'), "should include 'a fake param' but instead was (#{s.to_s})")
171
+ @t.prepare_to_send!
172
+ @t.params[:fake_key] = 'a fake param'
173
+ assert(@t.to_s.include?('fake_key'), "should include 'fake_key' but instead was (#{@t.to_s})")
174
+ assert(@t.to_s.include?('a fake param'), "should include 'a fake param' but instead was (#{@t.to_s})")
165
175
  end
166
176
 
167
177
  def test_find_segment
168
- s = @t.prepare_to_send!(:explain_sql => 0.1)
178
+ s = @t.prepare_to_send!
169
179
  fake_segment = mock('segment')
170
180
  fake_segment.expects(:find_segment).with(1).returns('a segment')
171
181
  s.instance_eval do
@@ -176,7 +186,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
176
186
  end
177
187
 
178
188
  def test_timestamp
179
- s = @t.prepare_to_send!(:explain_sql => 0.1)
189
+ s = @t.prepare_to_send!
180
190
  assert(s.timestamp.instance_of?(Float), "s.timestamp should be a Float, but is #{s.timestamp.class.inspect}")
181
191
  end
182
192
 
@@ -193,13 +203,10 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
193
203
  end
194
204
 
195
205
  def test_prepare_to_send_does_not_re_prepare
196
- opts = { :record_sql => :raw, :explain_sql => 0.00001 }
197
- @t.prepare_to_send!(opts)
198
-
206
+ @t.prepare_to_send!
199
207
  @t.expects(:collect_explain_plans!).never
200
208
  @t.expects(:prepare_sql_for_transmission!).never
201
-
202
- @t.prepare_to_send!(opts)
209
+ @t.prepare_to_send!
203
210
  end
204
211
 
205
212
  def test_threshold_preserved_by_prepare_to_send
@@ -284,6 +291,21 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
284
291
  assert_equal expected, transaction.to_collector_array(@marshaller.default_encoder)
285
292
  end
286
293
 
294
+ INVALID_UTF8_STRING = (''.respond_to?(:force_encoding) ? "\x80".force_encoding('UTF-8') : "\x80")
295
+
296
+ def test_prepare_to_send_with_incorrectly_encoded_string_in_sql_query
297
+ query = "SELECT * FROM table WHERE col1=\"#{INVALID_UTF8_STRING}\" AND col2=\"whatev\""
298
+
299
+ t = nil
300
+ with_config(:'transaction_tracer.record_sql' => 'obfuscated') do
301
+ t = make_sql_transaction(query, query)
302
+ t.prepare_to_send!
303
+ end
304
+
305
+ sql_statements = extract_captured_sql(t)
306
+ assert_equal(["SELECT * FROM table WHERE col1=? AND col2=?"], sql_statements)
307
+ end
308
+
287
309
  def trace_tree(transaction=@t)
288
310
  if NewRelic::Agent::NewRelicService::JsonMarshaller.is_supported?
289
311
  trace_tree = compress(transaction.to_json)
@@ -295,4 +317,12 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
295
317
  def compress(string)
296
318
  Base64.encode64(Zlib::Deflate.deflate(string, Zlib::DEFAULT_COMPRESSION))
297
319
  end
320
+
321
+ def extract_captured_sql(trace)
322
+ sqls = []
323
+ trace.each_segment do |s|
324
+ sqls << s.params[:sql]
325
+ end
326
+ sqls.compact
327
+ end
298
328
  end
@@ -22,9 +22,6 @@ class RumAutoInsertion < Performance::TestCase
22
22
  :license_key => 'a' * 40
23
23
  }
24
24
  NewRelic::Agent.config.apply_config(@config)
25
- NewRelic::Agent.instance.instance_eval do
26
- @beacon_configuration = NewRelic::Agent::BeaconConfiguration.new
27
- end
28
25
 
29
26
  @browser_monitor = NewRelic::Rack::BrowserMonitoring.new(nil)
30
27
  @html = "<html><head>#{'<script>alert("boo");</script>' * 1_000}</head><body></body></html>"
@@ -0,0 +1,10 @@
1
+ <html>
2
+ <head>
3
+ <title>im a title</title>
4
+ <meta http-equiv = "X-UA-Compatible" content="IE=edge,chrome=1"/>|||I AM THE RUM FOOTER||||||I AM THE RUM HEADER|||
5
+ <script>
6
+ junk
7
+ </script>
8
+ </head>
9
+ <body>im some body text</body>
10
+ </html>
@@ -0,0 +1,10 @@
1
+ <html>
2
+ <head>
3
+ <title>im a title</title>
4
+ <meta http-equiv = "X-UA-Compatible" content="IE=edge,chrome=1"/>
5
+ <script>
6
+ junk
7
+ </script>
8
+ </head>
9
+ <body>im some body text</body>
10
+ </html>
@@ -14,6 +14,7 @@ $LOAD_PATH.uniq!
14
14
 
15
15
  require 'rubygems'
16
16
  require 'rake'
17
+ Dir.glob('test/helpers/*').each { |f| require f }
17
18
 
18
19
  Dir.glob(File.join(NEWRELIC_PLUGIN_DIR,'test/helpers/*.rb')).each do |helper|
19
20
  require helper
@@ -117,11 +118,12 @@ end
117
118
  def with_verbose_logging
118
119
  orig_logger = NewRelic::Agent.logger
119
120
  $stderr.puts '', '---', ''
120
- new_logger = NewRelic::Agent::AgentLogger.new( {:log_level => 'debug'}, '', Logger.new($stderr) )
121
+ new_logger = NewRelic::Agent::AgentLogger.new('', Logger.new($stderr) )
121
122
  NewRelic::Agent.logger = new_logger
122
123
 
123
- yield
124
-
124
+ with_config(:log_level => 'debug') do
125
+ yield
126
+ end
125
127
  ensure
126
128
  NewRelic::Agent.logger = orig_logger
127
129
  end
@@ -210,9 +212,11 @@ def with_array_logger( level=:info )
210
212
  }
211
213
  logdev = ArrayLogDevice.new
212
214
  override_logger = Logger.new( logdev )
213
- NewRelic::Agent.logger = NewRelic::Agent::AgentLogger.new(config, "", override_logger)
215
+ NewRelic::Agent.logger = NewRelic::Agent::AgentLogger.new("", override_logger)
214
216
 
215
- yield
217
+ with_config(config) do
218
+ yield
219
+ end
216
220
 
217
221
  return logdev
218
222
  ensure
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0.174.beta
5
- prerelease: 10
4
+ version: 3.7.0.177
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jason Clark
@@ -40,7 +40,7 @@ cert_chain:
40
40
  cHUySWFQWE92bTNUOEc0TzZxWnZobkxoL1VpZW4rK0RqOGVGQmVjVFBvTThw
41
41
  VmpLM3BoNQpuL0V3dVpDY0U2Z2h0Q0NNCi0tLS0tRU5EIENFUlRJRklDQVRF
42
42
  LS0tLS0K
43
- date: 2013-11-22 00:00:00.000000000 Z
43
+ date: 2013-12-05 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: rake
@@ -291,8 +291,6 @@ files:
291
291
  - lib/new_relic/agent/agent_logger.rb
292
292
  - lib/new_relic/agent/audit_logger.rb
293
293
  - lib/new_relic/agent/autostart.rb
294
- - lib/new_relic/agent/beacon_configuration.rb
295
- - lib/new_relic/agent/browser_monitoring.rb
296
294
  - lib/new_relic/agent/browser_token.rb
297
295
  - lib/new_relic/agent/busy_calculator.rb
298
296
  - lib/new_relic/agent/chained_call.rb
@@ -367,10 +365,12 @@ files:
367
365
  - lib/new_relic/agent/instrumentation/typhoeus.rb
368
366
  - lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb
369
367
  - lib/new_relic/agent/internal_agent_error.rb
368
+ - lib/new_relic/agent/javascript_instrumentor.rb
370
369
  - lib/new_relic/agent/memory_logger.rb
371
370
  - lib/new_relic/agent/method_tracer.rb
372
371
  - lib/new_relic/agent/new_relic_service.rb
373
372
  - lib/new_relic/agent/null_logger.rb
373
+ - lib/new_relic/agent/obfuscator.rb
374
374
  - lib/new_relic/agent/pipe_channel_manager.rb
375
375
  - lib/new_relic/agent/pipe_service.rb
376
376
  - lib/new_relic/agent/request_sampler.rb
@@ -545,6 +545,7 @@ files:
545
545
  - test/environments/rails40/config/environment.rb
546
546
  - test/environments/rails40/db/schema.rb
547
547
  - test/fixtures/proc_cpuinfo.txt
548
+ - test/helpers/file_searching.rb
548
549
  - test/helpers/runtime_detection.rb
549
550
  - test/intentional_fail.rb
550
551
  - test/multiverse/.gitignore
@@ -563,6 +564,7 @@ files:
563
564
  - test/multiverse/suites/agent_only/Envfile
564
565
  - test/multiverse/suites/agent_only/audit_log_test.rb
565
566
  - test/multiverse/suites/agent_only/before_suite.rb
567
+ - test/multiverse/suites/agent_only/collector_exception_handling_test.rb
566
568
  - test/multiverse/suites/agent_only/config/newrelic.yml
567
569
  - test/multiverse/suites/agent_only/cross_application_tracing_test.rb
568
570
  - test/multiverse/suites/agent_only/http_response_code_test.rb
@@ -667,8 +669,6 @@ files:
667
669
  - test/new_relic/agent/apdex_from_server_test.rb
668
670
  - test/new_relic/agent/audit_logger_test.rb
669
671
  - test/new_relic/agent/autostart_test.rb
670
- - test/new_relic/agent/beacon_configuration_test.rb
671
- - test/new_relic/agent/browser_monitoring_test.rb
672
672
  - test/new_relic/agent/browser_token_test.rb
673
673
  - test/new_relic/agent/busy_calculator_test.rb
674
674
  - test/new_relic/agent/commands/agent_command_router_test.rb
@@ -679,6 +679,7 @@ files:
679
679
  - test/new_relic/agent/configuration/default_source_test.rb
680
680
  - test/new_relic/agent/configuration/environment_source_test.rb
681
681
  - test/new_relic/agent/configuration/manager_test.rb
682
+ - test/new_relic/agent/configuration/orphan_configuration_test.rb
682
683
  - test/new_relic/agent/configuration/server_source_test.rb
683
684
  - test/new_relic/agent/configuration/yaml_source_test.rb
684
685
  - test/new_relic/agent/cpu_sampler_test.rb
@@ -702,6 +703,7 @@ files:
702
703
  - test/new_relic/agent/instrumentation/sinatra/transaction_namer_test.rb
703
704
  - test/new_relic/agent/instrumentation/sinatra_test.rb
704
705
  - test/new_relic/agent/instrumentation/task_instrumentation_test.rb
706
+ - test/new_relic/agent/javascript_instrumentor_test.rb
705
707
  - test/new_relic/agent/memcache_instrumentation_test.rb
706
708
  - test/new_relic/agent/memory_logger_test.rb
707
709
  - test/new_relic/agent/method_interrobang_test.rb
@@ -711,6 +713,7 @@ files:
711
713
  - test/new_relic/agent/method_visibility_test.rb
712
714
  - test/new_relic/agent/mock_scope_listener.rb
713
715
  - test/new_relic/agent/new_relic_service_test.rb
716
+ - test/new_relic/agent/obfuscator_test.rb
714
717
  - test/new_relic/agent/pipe_channel_manager_test.rb
715
718
  - test/new_relic/agent/pipe_service_test.rb
716
719
  - test/new_relic/agent/request_sampler_test.rb
@@ -752,6 +755,7 @@ files:
752
755
  - test/new_relic/control/class_methods_test.rb
753
756
  - test/new_relic/control/frameworks/rails_test.rb
754
757
  - test/new_relic/control_test.rb
758
+ - test/new_relic/data_container_tests.rb
755
759
  - test/new_relic/dependency_detection_test.rb
756
760
  - test/new_relic/dispatcher_test.rb
757
761
  - test/new_relic/environment_report_test.rb
@@ -843,6 +847,8 @@ files:
843
847
  - test/rum/x_ua_meta_tag.source.html
844
848
  - test/rum/x_ua_meta_tag_multiline.result.html
845
849
  - test/rum/x_ua_meta_tag_multiline.source.html
850
+ - test/rum/x_ua_meta_tag_spaces_around_equals.result.html
851
+ - test/rum/x_ua_meta_tag_spaces_around_equals.source.html
846
852
  - test/rum/x_ua_meta_tag_with_others.result.html
847
853
  - test/rum/x_ua_meta_tag_with_others.source.html
848
854
  - test/rum/x_ua_meta_tag_with_spaces.result.html
@@ -935,10 +941,22 @@ files:
935
941
  homepage: http://www.github.com/newrelic/rpm
936
942
  licenses: []
937
943
  post_install_message: ! "# New Relic Ruby Agent Release Notes #\n\n## v3.7.0 ##\n\n*
938
- RUM injection updates\n\n The Ruby agent's code for both automatically and manually
939
- injecting the Real\n User Monitoring scripts has been updated. This should not
940
- require\n application changes, but does result in a different script being injected\n
941
- \ than previous versions of the agent.\n\nSee https://github.com/newrelic/rpm/blob/master/CHANGELOG
944
+ Official Rubinius support (for Rubinius >= 2.2.1)\n\n We're happy to say that all
945
+ known issues with the Ruby agent running on \n Rubinius have been resolved as of
946
+ Rubinius version 2.2.1! See\n http://docs.newrelic.com/docs/ruby/rubinius for the
947
+ most up-to-date status.\n\n* RUM injection updates\n\n The Ruby agent's code for
948
+ both automatic and manual injection of Real User\n Monitoring scripts has been
949
+ improved. No application changes are required, but\n the new injection logic is
950
+ simpler, faster, more robust, and paves the way for\n future improvements to Real
951
+ User Monitoring.\n\n* More robust communication with New Relic\n\n Failures when
952
+ transmitting data to New Relic could cause data to be held over\n unnecessarily
953
+ to a later harvest. This has been improved both to handle\n errors more robustly
954
+ and consistently, and to send data as soon as possible.\n\n* Fix for agent not restarting
955
+ on server-side config changes\n\n A bug in 3.6.9 caused the agent to not reset
956
+ correctly after server-side\n config changes. New settings would not be received
957
+ without a full process\n restart. This has been fixed.\n\n* Blacklisting rake spec
958
+ tasks\n\n A blacklist helps the agent avoid starting during rake tasks. Some default\n
959
+ \ RSpec tasks were missing. Thanks for the contribution Kohei Hasegawa!\n\nSee https://github.com/newrelic/rpm/blob/master/CHANGELOG
942
960
  for a full list of\nchanges.\n"
943
961
  rdoc_options:
944
962
  - --line-numbers