newrelic_rpm 3.9.6.257 → 3.9.7.266
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +45 -0
- data/lib/new_relic/agent.rb +0 -1
- data/lib/new_relic/agent/agent.rb +61 -22
- data/lib/new_relic/agent/agent_logger.rb +11 -9
- data/lib/new_relic/agent/configuration/default_source.rb +25 -2
- data/lib/new_relic/agent/cross_app_monitor.rb +15 -53
- data/lib/new_relic/agent/cross_app_tracing.rb +11 -3
- data/lib/new_relic/agent/custom_event_aggregator.rb +98 -0
- data/lib/new_relic/agent/event_buffer.rb +84 -0
- data/lib/new_relic/agent/harvester.rb +4 -15
- data/lib/new_relic/agent/hostname.rb +1 -9
- data/lib/new_relic/agent/inbound_request_monitor.rb +41 -0
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/queue_time.rb +0 -5
- data/lib/new_relic/agent/instrumentation/resque.rb +4 -9
- data/lib/new_relic/agent/javascript_instrumentor.rb +0 -12
- data/lib/new_relic/agent/method_tracer_helpers.rb +3 -1
- data/lib/new_relic/agent/new_relic_service.rb +1 -1
- data/lib/new_relic/agent/sampled_buffer.rb +13 -41
- data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +52 -24
- data/lib/new_relic/agent/sized_buffer.rb +23 -0
- data/lib/new_relic/agent/synthetics_monitor.rb +50 -0
- data/lib/new_relic/agent/system_info.rb +28 -0
- data/lib/new_relic/agent/transaction.rb +78 -9
- data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +25 -0
- data/lib/new_relic/agent/{request_sampler.rb → transaction_event_aggregator.rb} +53 -19
- data/lib/new_relic/agent/transaction_sample_builder.rb +3 -1
- data/lib/new_relic/agent/transaction_sampler.rb +10 -0
- data/lib/new_relic/agent/transaction_state.rb +1 -9
- data/lib/new_relic/coerce.rb +8 -2
- data/lib/new_relic/control.rb +0 -1
- data/lib/new_relic/local_environment.rb +12 -8
- data/lib/new_relic/metric_spec.rb +11 -2
- data/lib/new_relic/rack/developer_mode.rb +9 -1
- data/lib/new_relic/transaction_sample.rb +4 -10
- data/lib/new_relic/version.rb +1 -1
- data/newrelic_rpm.gemspec +1 -0
- data/test/agent_helper.rb +15 -2
- data/test/environments/norails/Gemfile +1 -0
- data/test/environments/rails21/Gemfile +1 -0
- data/test/environments/rails22/Gemfile +1 -0
- data/test/environments/rails23/Gemfile +1 -0
- data/test/environments/rails30/Gemfile +1 -0
- data/test/environments/rails31/Gemfile +1 -0
- data/test/environments/rails32/Gemfile +2 -1
- data/test/environments/rails40/Gemfile +2 -1
- data/test/environments/rails41/Gemfile +3 -1
- data/test/environments/rails42/Gemfile +3 -1
- data/test/fixtures/cross_agent_tests/README.md +6 -2
- data/test/fixtures/cross_agent_tests/docker_container_id/README.md +6 -0
- data/test/fixtures/cross_agent_tests/docker_container_id/cases.json +22 -0
- data/test/fixtures/cross_agent_tests/docker_container_id/docker-0.9.1.txt +10 -0
- data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.0.0.txt +10 -0
- data/test/fixtures/cross_agent_tests/docker_container_id/docker-1.3.txt +9 -0
- data/test/fixtures/cross_agent_tests/docker_container_id/empty.txt +0 -0
- data/test/fixtures/cross_agent_tests/docker_container_id/lxc-containers-without-docker.txt +10 -0
- data/test/fixtures/cross_agent_tests/proc_meminfo/README.md +7 -0
- data/test/fixtures/cross_agent_tests/proc_meminfo/meminfo_4096MB.txt +47 -0
- data/test/fixtures/cross_agent_tests/rum_client_config.json +0 -80
- data/test/fixtures/cross_agent_tests/synthetics/synthetics.json +317 -0
- data/test/multiverse/lib/multiverse/runner.rb +1 -1
- data/test/multiverse/lib/multiverse/suite.rb +1 -0
- data/test/multiverse/suites/active_record/Envfile +42 -8
- data/test/multiverse/suites/active_record/ar_method_aliasing.rb +8 -4
- data/test/multiverse/suites/agent_only/audit_log_test.rb +0 -2
- data/test/multiverse/suites/agent_only/collector_exception_handling_test.rb +1 -2
- data/test/multiverse/suites/agent_only/cross_application_tracing_test.rb +5 -5
- data/test/multiverse/suites/agent_only/encoding_handling_test.rb +2 -0
- data/test/multiverse/suites/agent_only/harvest_timestamps_test.rb +8 -0
- data/test/multiverse/suites/agent_only/synthetics_test.rb +139 -0
- data/test/multiverse/suites/delayed_job/Envfile +79 -0
- data/test/multiverse/suites/delayed_job/before_suite.rb +33 -0
- data/test/multiverse/suites/delayed_job/config/newrelic.yml +18 -0
- data/test/multiverse/suites/delayed_job/delayed_job_sampler_test.rb +131 -0
- data/test/multiverse/suites/delayed_job/unsupported_backend_test.rb +24 -0
- data/test/multiverse/suites/high_security/high_security_test.rb +3 -10
- data/test/multiverse/suites/rails/Envfile +4 -4
- data/test/multiverse/suites/rails/request_statistics_test.rb +4 -4
- data/test/new_relic/agent/agent_test.rb +32 -4
- data/test/new_relic/agent/configuration/default_source_test.rb +6 -0
- data/test/new_relic/agent/cross_app_monitor_test.rb +23 -29
- data/test/new_relic/agent/custom_event_aggregator_test.rb +88 -0
- data/test/new_relic/agent/event_buffer_test_cases.rb +152 -0
- data/test/new_relic/agent/harvester_test.rb +5 -25
- data/test/new_relic/agent/hostname_test.rb +1 -1
- data/test/new_relic/agent/inbound_request_monitor_test.rb +49 -0
- data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +9 -9
- data/test/new_relic/agent/instrumentation/queue_time_test.rb +0 -19
- data/test/new_relic/agent/javascript_instrumentor_test.rb +0 -45
- data/test/new_relic/agent/new_relic_service_test.rb +17 -12
- data/test/new_relic/agent/pipe_channel_manager_test.rb +4 -4
- data/test/new_relic/agent/sampled_buffer_test.rb +73 -145
- data/test/new_relic/agent/sized_buffer_test.rb +29 -0
- data/test/new_relic/agent/synthetics_monitor_test.rb +96 -0
- data/test/new_relic/agent/system_info_test.rb +19 -3
- data/test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb +14 -8
- data/test/new_relic/agent/transaction/synthetics_sample_buffer_test.rb +38 -0
- data/test/new_relic/agent/{request_sampler_test.rb → transaction_event_aggregator_test.rb} +55 -4
- data/test/new_relic/agent/transaction_sampler_test.rb +33 -11
- data/test/new_relic/agent/transaction_state_test.rb +0 -1
- data/test/new_relic/agent/transaction_test.rb +121 -19
- data/test/new_relic/coerce_test.rb +38 -3
- data/test/new_relic/control_test.rb +1 -0
- data/test/new_relic/fake_collector.rb +6 -2
- data/test/new_relic/fake_external_server.rb +2 -6
- data/test/new_relic/fake_server.rb +46 -29
- data/test/new_relic/http_client_test_cases.rb +71 -2
- data/test/new_relic/local_environment_test.rb +78 -0
- data/test/new_relic/metric_parser/metric_parser_test.rb +2 -0
- data/test/new_relic/metric_spec_test.rb +43 -0
- data/test/new_relic/multiverse_helpers.rb +11 -18
- data/test/new_relic/rack/browser_monitoring_test.rb +1 -18
- data/test/new_relic/rack/developer_mode_test.rb +1 -1
- data/test/new_relic/transaction_sample_test.rb +14 -4
- data/test/performance/suites/rack_middleware.rb +3 -1
- data/test/test_helper.rb +33 -0
- metadata +48 -7
- metadata.gz.sig +0 -0
- data/lib/new_relic/agent/browser_token.rb +0 -41
- data/test/multiverse/suites/agent_only/before_suite.rb +0 -7
- data/test/new_relic/agent/browser_token_test.rb +0 -56
@@ -21,7 +21,7 @@ class DeveloperModeTest < Minitest::Test
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def setup
|
24
|
-
@test_config = { :developer_mode => true }
|
24
|
+
@test_config = { :developer_mode => true, :disable_harvest_thread => true }
|
25
25
|
NewRelic::Agent.config.add_config_for_testing(@test_config)
|
26
26
|
run_sample_trace('/here')
|
27
27
|
run_sample_trace('/there')
|
@@ -6,9 +6,13 @@ require File.expand_path('../../test_helper.rb', __FILE__)
|
|
6
6
|
|
7
7
|
class NewRelic::TransactionSampleTest < Minitest::Test
|
8
8
|
include TransactionSampleTestHelper
|
9
|
+
|
9
10
|
::SQL_STATEMENT = "SELECT * from sandwiches WHERE meat='bacon'"
|
10
11
|
::OBFUSCATED_SQL_STATEMENT = "SELECT * from sandwiches WHERE meat=?"
|
11
12
|
|
13
|
+
FORCE_PERSIST_POSITION = 7
|
14
|
+
SYNTHETICS_POSITION = 9
|
15
|
+
|
12
16
|
def setup
|
13
17
|
@test_config = { :developer_mode => true }
|
14
18
|
NewRelic::Agent.config.add_config_for_testing(@test_config)
|
@@ -258,7 +262,9 @@ class NewRelic::TransactionSampleTest < Minitest::Test
|
|
258
262
|
(@t.duration * 1000).round,
|
259
263
|
@t.params[:path], @t.params[:uri],
|
260
264
|
trace_tree,
|
261
|
-
@t.guid, nil, !!@t.force_persist,
|
265
|
+
@t.guid, nil, !!@t.force_persist,
|
266
|
+
@t.xray_session_id,
|
267
|
+
@t.synthetics_resource_id]
|
262
268
|
|
263
269
|
assert_collector_arrays_match expected_array, @t.to_collector_array(@marshaller.default_encoder)
|
264
270
|
|
@@ -271,8 +277,6 @@ class NewRelic::TransactionSampleTest < Minitest::Test
|
|
271
277
|
assert_equal expected_array, actual_array
|
272
278
|
end
|
273
279
|
|
274
|
-
FORCE_PERSIST_POSITION = 7
|
275
|
-
|
276
280
|
def test_to_collector_array_forces_xrays
|
277
281
|
@t.force_persist = false
|
278
282
|
@t.xray_session_id = 123
|
@@ -280,6 +284,12 @@ class NewRelic::TransactionSampleTest < Minitest::Test
|
|
280
284
|
assert_equal true, result[FORCE_PERSIST_POSITION]
|
281
285
|
end
|
282
286
|
|
287
|
+
def test_to_collector_array_uses_synthetics_resource_id
|
288
|
+
@t.synthetics_resource_id = '42'
|
289
|
+
result = @t.to_collector_array(@marshaller.default_encoder)
|
290
|
+
assert_equal '42', result[SYNTHETICS_POSITION]
|
291
|
+
end
|
292
|
+
|
283
293
|
def test_to_collector_array_with_bad_values
|
284
294
|
transaction = NewRelic::TransactionSample.new(nil)
|
285
295
|
transaction.root_segment.end_trace(Rational(10, 1))
|
@@ -290,7 +300,7 @@ class NewRelic::TransactionSampleTest < Minitest::Test
|
|
290
300
|
nil, nil,
|
291
301
|
trace_tree(transaction),
|
292
302
|
transaction.guid,
|
293
|
-
nil, false, nil]
|
303
|
+
nil, false, nil, nil]
|
294
304
|
|
295
305
|
actual = transaction.to_collector_array(@marshaller.default_encoder)
|
296
306
|
assert_collector_arrays_match expected, actual
|
@@ -50,14 +50,16 @@ class RackMiddleware < Performance::TestCase
|
|
50
50
|
:disable_mobile_headers => false,
|
51
51
|
:browser_key => 'browserKey',
|
52
52
|
:js_agent_loader => 'loader',
|
53
|
+
:encoding_key => 'lolz',
|
53
54
|
:application_id => '5, 6', # collector can return app multiple ids
|
54
55
|
:'rum.enabled' => true,
|
55
|
-
:episodes_file => 'this_is_my_file',
|
56
56
|
:license_key => 'a' * 40,
|
57
57
|
:developer_mode => false
|
58
58
|
}
|
59
59
|
NewRelic::Agent.config.add_config_for_testing(@config)
|
60
60
|
|
61
|
+
NewRelic::Agent.agent.events.notify(:finished_configuring)
|
62
|
+
|
61
63
|
@stack = Rack::Builder.new do
|
62
64
|
use TestMiddlewareA
|
63
65
|
use TestMiddlewareB
|
data/test/test_helper.rb
CHANGED
@@ -22,6 +22,39 @@ unless defined?(Minitest::Test)
|
|
22
22
|
Minitest::Test = MiniTest::Unit::TestCase
|
23
23
|
end
|
24
24
|
|
25
|
+
require 'hometown'
|
26
|
+
Hometown.watch(::Thread)
|
27
|
+
|
28
|
+
# Set up a watcher for leaking agent threads out of tests. It'd be nice to
|
29
|
+
# disable the threads everywhere, but not all tests have newrelic.yml loaded to
|
30
|
+
# us to rely on, so instead we'll just watch for it.
|
31
|
+
class Minitest::Test
|
32
|
+
def before_setup
|
33
|
+
@__thread_count = ruby_threads.count
|
34
|
+
super
|
35
|
+
end
|
36
|
+
|
37
|
+
def after_teardown
|
38
|
+
threads = ruby_threads
|
39
|
+
if @__thread_count != threads.count
|
40
|
+
backtraces = threads.map do |thread|
|
41
|
+
trace = Hometown.for(thread)
|
42
|
+
trace.backtrace.join("\n ")
|
43
|
+
end.join("\n\n")
|
44
|
+
|
45
|
+
fail "Thread count changed in this test from #{@__thread_count} to #{threads.count}\n#{backtraces}"
|
46
|
+
end
|
47
|
+
|
48
|
+
super
|
49
|
+
end
|
50
|
+
|
51
|
+
# We only want to count threads that were spun up from Ruby (i.e.
|
52
|
+
# Thread.new) JRuby has system threads we don't care to track.
|
53
|
+
def ruby_threads
|
54
|
+
Thread.list.select { |t| Hometown.for(t) }
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
25
58
|
Dir.glob('test/helpers/*').each { |f| require f }
|
26
59
|
|
27
60
|
Dir.glob(File.join(NEWRELIC_PLUGIN_DIR,'test/helpers/*.rb')).each do |helper|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.
|
4
|
+
version: 3.9.7.266
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -41,7 +41,7 @@ cert_chain:
|
|
41
41
|
K0ZZTXduQWIrVm1OT2h2MVMrc0poYmpaMzBQS2d6NnZMaFQ2dW5pZUNqTGs5
|
42
42
|
d0dHbWxTSwpZamJudkE5cXJhTExhalNqCi0tLS0tRU5EIENFUlRJRklDQVRF
|
43
43
|
LS0tLS0K
|
44
|
-
date: 2014-
|
44
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
45
45
|
dependencies:
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: rake
|
@@ -187,6 +187,22 @@ dependencies:
|
|
187
187
|
- - ~>
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: 0.9.1
|
190
|
+
- !ruby/object:Gem::Dependency
|
191
|
+
name: hometown
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
194
|
+
requirements:
|
195
|
+
- - ~>
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: 0.2.5
|
198
|
+
type: :development
|
199
|
+
prerelease: false
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - ~>
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 0.2.5
|
190
206
|
- !ruby/object:Gem::Dependency
|
191
207
|
name: sqlite3
|
192
208
|
requirement: !ruby/object:Gem::Requirement
|
@@ -258,7 +274,6 @@ files:
|
|
258
274
|
- lib/new_relic/agent/agent_logger.rb
|
259
275
|
- lib/new_relic/agent/audit_logger.rb
|
260
276
|
- lib/new_relic/agent/autostart.rb
|
261
|
-
- lib/new_relic/agent/browser_token.rb
|
262
277
|
- lib/new_relic/agent/busy_calculator.rb
|
263
278
|
- lib/new_relic/agent/chained_call.rb
|
264
279
|
- lib/new_relic/agent/commands/agent_command.rb
|
@@ -278,6 +293,7 @@ files:
|
|
278
293
|
- lib/new_relic/agent/configuration/yaml_source.rb
|
279
294
|
- lib/new_relic/agent/cross_app_monitor.rb
|
280
295
|
- lib/new_relic/agent/cross_app_tracing.rb
|
296
|
+
- lib/new_relic/agent/custom_event_aggregator.rb
|
281
297
|
- lib/new_relic/agent/database.rb
|
282
298
|
- lib/new_relic/agent/database/obfuscation_helpers.rb
|
283
299
|
- lib/new_relic/agent/database/obfuscator.rb
|
@@ -288,6 +304,7 @@ files:
|
|
288
304
|
- lib/new_relic/agent/datastores/mongo/obfuscator.rb
|
289
305
|
- lib/new_relic/agent/datastores/mongo/statement_formatter.rb
|
290
306
|
- lib/new_relic/agent/error_collector.rb
|
307
|
+
- lib/new_relic/agent/event_buffer.rb
|
291
308
|
- lib/new_relic/agent/event_listener.rb
|
292
309
|
- lib/new_relic/agent/event_loop.rb
|
293
310
|
- lib/new_relic/agent/harvester.rb
|
@@ -298,6 +315,7 @@ files:
|
|
298
315
|
- lib/new_relic/agent/http_clients/net_http_wrappers.rb
|
299
316
|
- lib/new_relic/agent/http_clients/typhoeus_wrappers.rb
|
300
317
|
- lib/new_relic/agent/http_clients/uri_util.rb
|
318
|
+
- lib/new_relic/agent/inbound_request_monitor.rb
|
301
319
|
- lib/new_relic/agent/instrumentation.rb
|
302
320
|
- lib/new_relic/agent/instrumentation/action_controller_subscriber.rb
|
303
321
|
- lib/new_relic/agent/instrumentation/action_view_subscriber.rb
|
@@ -364,7 +382,6 @@ files:
|
|
364
382
|
- lib/new_relic/agent/obfuscator.rb
|
365
383
|
- lib/new_relic/agent/pipe_channel_manager.rb
|
366
384
|
- lib/new_relic/agent/pipe_service.rb
|
367
|
-
- lib/new_relic/agent/request_sampler.rb
|
368
385
|
- lib/new_relic/agent/rules_engine.rb
|
369
386
|
- lib/new_relic/agent/rules_engine/replacement_rule.rb
|
370
387
|
- lib/new_relic/agent/rules_engine/segment_terms_rule.rb
|
@@ -377,6 +394,7 @@ files:
|
|
377
394
|
- lib/new_relic/agent/samplers/object_sampler.rb
|
378
395
|
- lib/new_relic/agent/samplers/vm_sampler.rb
|
379
396
|
- lib/new_relic/agent/shim_agent.rb
|
397
|
+
- lib/new_relic/agent/sized_buffer.rb
|
380
398
|
- lib/new_relic/agent/sql_sampler.rb
|
381
399
|
- lib/new_relic/agent/stats.rb
|
382
400
|
- lib/new_relic/agent/stats_engine.rb
|
@@ -385,6 +403,7 @@ files:
|
|
385
403
|
- lib/new_relic/agent/stats_engine/samplers.rb
|
386
404
|
- lib/new_relic/agent/stats_engine/stats_hash.rb
|
387
405
|
- lib/new_relic/agent/supported_versions.rb
|
406
|
+
- lib/new_relic/agent/synthetics_monitor.rb
|
388
407
|
- lib/new_relic/agent/system_info.rb
|
389
408
|
- lib/new_relic/agent/threading/agent_thread.rb
|
390
409
|
- lib/new_relic/agent/threading/backtrace_node.rb
|
@@ -395,8 +414,10 @@ files:
|
|
395
414
|
- lib/new_relic/agent/transaction/developer_mode_sample_buffer.rb
|
396
415
|
- lib/new_relic/agent/transaction/force_persist_sample_buffer.rb
|
397
416
|
- lib/new_relic/agent/transaction/slowest_sample_buffer.rb
|
417
|
+
- lib/new_relic/agent/transaction/synthetics_sample_buffer.rb
|
398
418
|
- lib/new_relic/agent/transaction/transaction_sample_buffer.rb
|
399
419
|
- lib/new_relic/agent/transaction/xray_sample_buffer.rb
|
420
|
+
- lib/new_relic/agent/transaction_event_aggregator.rb
|
400
421
|
- lib/new_relic/agent/transaction_metrics.rb
|
401
422
|
- lib/new_relic/agent/transaction_sample_builder.rb
|
402
423
|
- lib/new_relic/agent/transaction_sampler.rb
|
@@ -564,6 +585,13 @@ files:
|
|
564
585
|
- test/fixtures/cross_agent_tests/README.md
|
565
586
|
- test/fixtures/cross_agent_tests/attribute_configuration.json
|
566
587
|
- test/fixtures/cross_agent_tests/cat_map.json
|
588
|
+
- test/fixtures/cross_agent_tests/docker_container_id/README.md
|
589
|
+
- test/fixtures/cross_agent_tests/docker_container_id/cases.json
|
590
|
+
- test/fixtures/cross_agent_tests/docker_container_id/docker-0.9.1.txt
|
591
|
+
- test/fixtures/cross_agent_tests/docker_container_id/docker-1.0.0.txt
|
592
|
+
- test/fixtures/cross_agent_tests/docker_container_id/docker-1.3.txt
|
593
|
+
- test/fixtures/cross_agent_tests/docker_container_id/empty.txt
|
594
|
+
- test/fixtures/cross_agent_tests/docker_container_id/lxc-containers-without-docker.txt
|
567
595
|
- test/fixtures/cross_agent_tests/labels.json
|
568
596
|
- test/fixtures/cross_agent_tests/postgres_explain_obfuscation/README.md
|
569
597
|
- test/fixtures/cross_agent_tests/postgres_explain_obfuscation/basic_where.colon_obfuscated.txt
|
@@ -663,6 +691,8 @@ files:
|
|
663
691
|
- test/fixtures/cross_agent_tests/proc_cpuinfo/8pack_8core_8logical.txt
|
664
692
|
- test/fixtures/cross_agent_tests/proc_cpuinfo/README.md
|
665
693
|
- test/fixtures/cross_agent_tests/proc_cpuinfo/Xpack_Xcore_2logical.txt
|
694
|
+
- test/fixtures/cross_agent_tests/proc_meminfo/README.md
|
695
|
+
- test/fixtures/cross_agent_tests/proc_meminfo/meminfo_4096MB.txt
|
666
696
|
- test/fixtures/cross_agent_tests/rules.json
|
667
697
|
- test/fixtures/cross_agent_tests/rum_client_config.json
|
668
698
|
- test/fixtures/cross_agent_tests/rum_cookie.json
|
@@ -760,6 +790,7 @@ files:
|
|
760
790
|
- test/fixtures/cross_agent_tests/sql_obfuscation/string_with_twin_single_quotes.obfuscated
|
761
791
|
- test/fixtures/cross_agent_tests/sql_obfuscation/string_with_twin_single_quotes.sql
|
762
792
|
- test/fixtures/cross_agent_tests/sql_parsing.json
|
793
|
+
- test/fixtures/cross_agent_tests/synthetics/synthetics.json
|
763
794
|
- test/fixtures/cross_agent_tests/transaction_segment_terms.json
|
764
795
|
- test/fixtures/cross_agent_tests/url_clean.json
|
765
796
|
- test/fixtures/cross_agent_tests/url_domain_extraction.json
|
@@ -785,7 +816,6 @@ files:
|
|
785
816
|
- test/multiverse/suites/agent_only/Envfile
|
786
817
|
- test/multiverse/suites/agent_only/agent_run_id_handling_test.rb
|
787
818
|
- test/multiverse/suites/agent_only/audit_log_test.rb
|
788
|
-
- test/multiverse/suites/agent_only/before_suite.rb
|
789
819
|
- test/multiverse/suites/agent_only/collector_exception_handling_test.rb
|
790
820
|
- test/multiverse/suites/agent_only/config/newrelic.yml
|
791
821
|
- test/multiverse/suites/agent_only/cross_application_tracing_test.rb
|
@@ -807,6 +837,7 @@ files:
|
|
807
837
|
- test/multiverse/suites/agent_only/set_transaction_name_test.rb
|
808
838
|
- test/multiverse/suites/agent_only/ssl_test.rb
|
809
839
|
- test/multiverse/suites/agent_only/start_up_test.rb
|
840
|
+
- test/multiverse/suites/agent_only/synthetics_test.rb
|
810
841
|
- test/multiverse/suites/agent_only/testing_app.rb
|
811
842
|
- test/multiverse/suites/agent_only/thread_profiling_test.rb
|
812
843
|
- test/multiverse/suites/agent_only/transaction_ignoring_test.rb
|
@@ -835,6 +866,11 @@ files:
|
|
835
866
|
- test/multiverse/suites/deferred_instrumentation/Envfile
|
836
867
|
- test/multiverse/suites/deferred_instrumentation/config/newrelic.yml
|
837
868
|
- test/multiverse/suites/deferred_instrumentation/sinatra_test.rb
|
869
|
+
- test/multiverse/suites/delayed_job/Envfile
|
870
|
+
- test/multiverse/suites/delayed_job/before_suite.rb
|
871
|
+
- test/multiverse/suites/delayed_job/config/newrelic.yml
|
872
|
+
- test/multiverse/suites/delayed_job/delayed_job_sampler_test.rb
|
873
|
+
- test/multiverse/suites/delayed_job/unsupported_backend_test.rb
|
838
874
|
- test/multiverse/suites/excon/Envfile
|
839
875
|
- test/multiverse/suites/excon/config/newrelic.yml
|
840
876
|
- test/multiverse/suites/excon/excon_test.rb
|
@@ -962,7 +998,6 @@ files:
|
|
962
998
|
- test/new_relic/agent/apdex_from_server_test.rb
|
963
999
|
- test/new_relic/agent/audit_logger_test.rb
|
964
1000
|
- test/new_relic/agent/autostart_test.rb
|
965
|
-
- test/new_relic/agent/browser_token_test.rb
|
966
1001
|
- test/new_relic/agent/busy_calculator_test.rb
|
967
1002
|
- test/new_relic/agent/commands/agent_command_router_test.rb
|
968
1003
|
- test/new_relic/agent/commands/agent_command_test.rb
|
@@ -980,6 +1015,7 @@ files:
|
|
980
1015
|
- test/new_relic/agent/configuration/yaml_source_test.rb
|
981
1016
|
- test/new_relic/agent/cross_app_monitor_test.rb
|
982
1017
|
- test/new_relic/agent/cross_app_tracing_test.rb
|
1018
|
+
- test/new_relic/agent/custom_event_aggregator_test.rb
|
983
1019
|
- test/new_relic/agent/database/postgres_explain_obfuscator_test.rb
|
984
1020
|
- test/new_relic/agent/database/sql_obfuscation_test.rb
|
985
1021
|
- test/new_relic/agent/database_test.rb
|
@@ -989,11 +1025,13 @@ files:
|
|
989
1025
|
- test/new_relic/agent/datastores/mongo/statement_formatter_test.rb
|
990
1026
|
- test/new_relic/agent/error_collector/notice_error_test.rb
|
991
1027
|
- test/new_relic/agent/error_collector_test.rb
|
1028
|
+
- test/new_relic/agent/event_buffer_test_cases.rb
|
992
1029
|
- test/new_relic/agent/event_listener_test.rb
|
993
1030
|
- test/new_relic/agent/event_loop_test.rb
|
994
1031
|
- test/new_relic/agent/harvester_test.rb
|
995
1032
|
- test/new_relic/agent/hostname_test.rb
|
996
1033
|
- test/new_relic/agent/http_clients/uri_util_test.rb
|
1034
|
+
- test/new_relic/agent/inbound_request_monitor_test.rb
|
997
1035
|
- test/new_relic/agent/instrumentation/action_controller_subscriber_test.rb
|
998
1036
|
- test/new_relic/agent/instrumentation/action_view_subscriber_test.rb
|
999
1037
|
- test/new_relic/agent/instrumentation/active_job_test.rb
|
@@ -1024,7 +1062,6 @@ files:
|
|
1024
1062
|
- test/new_relic/agent/obfuscator_test.rb
|
1025
1063
|
- test/new_relic/agent/pipe_channel_manager_test.rb
|
1026
1064
|
- test/new_relic/agent/pipe_service_test.rb
|
1027
|
-
- test/new_relic/agent/request_sampler_test.rb
|
1028
1065
|
- test/new_relic/agent/rpm_agent_test.rb
|
1029
1066
|
- test/new_relic/agent/rules_engine_test.rb
|
1030
1067
|
- test/new_relic/agent/sampled_buffer_test.rb
|
@@ -1033,6 +1070,7 @@ files:
|
|
1033
1070
|
- test/new_relic/agent/samplers/cpu_sampler_test.rb
|
1034
1071
|
- test/new_relic/agent/samplers/vm_sampler_test.rb
|
1035
1072
|
- test/new_relic/agent/shim_agent_test.rb
|
1073
|
+
- test/new_relic/agent/sized_buffer_test.rb
|
1036
1074
|
- test/new_relic/agent/sql_sampler_test.rb
|
1037
1075
|
- test/new_relic/agent/stats_engine/gc_profiler_test.rb
|
1038
1076
|
- test/new_relic/agent/stats_engine/metric_stats_test.rb
|
@@ -1040,6 +1078,7 @@ files:
|
|
1040
1078
|
- test/new_relic/agent/stats_engine/stats_hash_test.rb
|
1041
1079
|
- test/new_relic/agent/stats_engine_test.rb
|
1042
1080
|
- test/new_relic/agent/stats_test.rb
|
1081
|
+
- test/new_relic/agent/synthetics_monitor_test.rb
|
1043
1082
|
- test/new_relic/agent/system_info_test.rb
|
1044
1083
|
- test/new_relic/agent/threading/agent_thread_test.rb
|
1045
1084
|
- test/new_relic/agent/threading/backtrace_node_test.rb
|
@@ -1051,7 +1090,9 @@ files:
|
|
1051
1090
|
- test/new_relic/agent/transaction/developer_mode_sample_buffer_test.rb
|
1052
1091
|
- test/new_relic/agent/transaction/force_persist_sample_buffer_test.rb
|
1053
1092
|
- test/new_relic/agent/transaction/slowest_sample_buffer_test.rb
|
1093
|
+
- test/new_relic/agent/transaction/synthetics_sample_buffer_test.rb
|
1054
1094
|
- test/new_relic/agent/transaction/xray_sample_buffer_test.rb
|
1095
|
+
- test/new_relic/agent/transaction_event_aggregator_test.rb
|
1055
1096
|
- test/new_relic/agent/transaction_interrobang_test.rb
|
1056
1097
|
- test/new_relic/agent/transaction_metrics_test.rb
|
1057
1098
|
- test/new_relic/agent/transaction_sample_builder_test.rb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,41 +0,0 @@
|
|
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 'erb'
|
6
|
-
|
7
|
-
module NewRelic
|
8
|
-
module Agent
|
9
|
-
module BrowserToken
|
10
|
-
|
11
|
-
def self.get_token(request)
|
12
|
-
return nil unless request
|
13
|
-
|
14
|
-
agent_flag = request.cookies['NRAGENT']
|
15
|
-
if agent_flag and agent_flag.instance_of? String
|
16
|
-
s = agent_flag.split("=")
|
17
|
-
if s.length == 2
|
18
|
-
if s[0] == "tk" && s[1]
|
19
|
-
sanitized = sanitize_token(s[1])
|
20
|
-
return nil unless sanitized
|
21
|
-
ERB::Util.h(sanitized)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
else
|
25
|
-
nil
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# Remove any non-alphanumeric characters from the token to avoid XSS attacks.
|
30
|
-
def self.sanitize_token(token)
|
31
|
-
if token.match(/[^a-zA-Z0-9]/)
|
32
|
-
::NewRelic::Agent.logger.log_once(:warn, :invalid_browser_token,
|
33
|
-
"Invalid characters found in browser token.")
|
34
|
-
nil
|
35
|
-
else
|
36
|
-
token
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,56 +0,0 @@
|
|
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 File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
|
6
|
-
require 'new_relic/agent/browser_token'
|
7
|
-
|
8
|
-
module NewRelic::Agent
|
9
|
-
class BrowserTokenTest < Minitest::Test
|
10
|
-
def assert_token(expected, cookies)
|
11
|
-
request = stub(:cookies => cookies)
|
12
|
-
assert_equal(expected, BrowserToken.get_token(request))
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_get_token_safe_token_returned_untouched
|
16
|
-
assert_token("12345678", 'NRAGENT' => 'tk=12345678')
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_get_token_with_embedded_tags_sanitized
|
20
|
-
assert_token(nil, 'NRAGENT' => 'tk=1234<tag>evil</tag>5678')
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_get_token_with_embedded_utf8_js_sanitized
|
24
|
-
assert_token(nil, 'NRAGENT' => "tk=1234"])򑛞")
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_get_token_with_embedded_utf7_js_sanitized
|
28
|
-
assert_token(nil, 'NRAGENT' => 'tk=+ADw-SCRIPT+AD4-alert(1)+ADw-/SCRIPT+AD4-')
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_get_token_replaces_double_quoted_token_with_empty_string
|
32
|
-
assert_token(nil, 'NRAGENT' => 'tk="""deadbeef"""')
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_get_token_replaces_single_quoted_token_with_empty_string
|
36
|
-
assert_token(nil, 'NRAGENT' => "tk='''deadbeef'''")
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_get_token_replaces_token_started_with_multiple_Lt_with_empty_string
|
40
|
-
assert_token(nil, 'NRAGENT' => 'tk=<<<deadbeef')
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_get_token_replaces_token_started_with_multiple_gt_with_empty_string
|
44
|
-
assert_token(nil, 'NRAGENT' => 'tk=>>>deadbeef')
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_get_token_bare_value_replaced_with_nil
|
48
|
-
assert_token(nil, 'NRAGENT' => 0xdeadbeef)
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_get_token_nil_token_returns_nil_token
|
52
|
-
assert_token(nil, 'NRAGENT' => nil)
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
end
|