newrelic_rpm 3.5.4.35.beta → 3.5.5.38
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +42 -0
- data/GUIDELINES_FOR_CONTRIBUTING.md +3 -0
- data/Rakefile +8 -0
- data/bin/mongrel_rpm +1 -1
- data/init.rb +1 -8
- data/lib/new_relic/agent.rb +11 -13
- data/lib/new_relic/agent/agent.rb +89 -110
- data/lib/new_relic/agent/agent_logger.rb +165 -0
- data/lib/new_relic/agent/audit_logger.rb +72 -0
- data/lib/new_relic/agent/beacon_configuration.rb +4 -4
- data/lib/new_relic/agent/browser_monitoring.rb +13 -7
- data/lib/new_relic/agent/busy_calculator.rb +2 -2
- data/lib/new_relic/agent/configuration.rb +25 -0
- data/lib/new_relic/agent/configuration/defaults.rb +45 -8
- data/lib/new_relic/agent/configuration/environment_source.rb +8 -15
- data/lib/new_relic/agent/configuration/manager.rb +22 -2
- data/lib/new_relic/agent/configuration/mask_defaults.rb +10 -0
- data/lib/new_relic/agent/configuration/yaml_source.rb +4 -2
- data/lib/new_relic/agent/cross_process_monitoring.rb +43 -0
- data/lib/new_relic/agent/database.rb +2 -4
- data/lib/new_relic/agent/error_collector.rb +4 -9
- data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record.rb +1 -1
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +1 -1
- data/lib/new_relic/agent/instrumentation/authlogic.rb +1 -1
- data/lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb +41 -0
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +7 -7
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +1 -1
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +1 -1
- data/lib/new_relic/agent/instrumentation/memcache.rb +4 -4
- data/lib/new_relic/agent/instrumentation/merb/controller.rb +1 -1
- data/lib/new_relic/agent/instrumentation/merb/errors.rb +1 -1
- data/lib/new_relic/agent/instrumentation/metric_frame/pop.rb +1 -1
- data/lib/new_relic/agent/instrumentation/net.rb +1 -1
- data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +4 -4
- data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails/errors.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +3 -3
- data/lib/new_relic/agent/instrumentation/rails3/errors.rb +1 -1
- data/lib/new_relic/agent/instrumentation/resque.rb +3 -2
- data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sunspot.rb +1 -1
- data/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb +2 -2
- data/lib/new_relic/agent/method_tracer.rb +6 -8
- data/lib/new_relic/agent/new_relic_service.rb +94 -106
- data/lib/new_relic/agent/pipe_channel_manager.rb +1 -1
- data/lib/new_relic/agent/samplers/memory_sampler.rb +4 -6
- data/lib/new_relic/agent/sql_sampler.rb +3 -18
- data/lib/new_relic/agent/stats_engine.rb +0 -5
- data/lib/new_relic/agent/stats_engine/metric_stats.rb +3 -3
- data/lib/new_relic/agent/stats_engine/samplers.rb +2 -4
- data/lib/new_relic/agent/thread.rb +8 -3
- data/lib/new_relic/agent/thread_profiler.rb +38 -27
- data/lib/new_relic/agent/transaction_info.rb +1 -1
- data/lib/new_relic/agent/transaction_sample_builder.rb +2 -3
- data/lib/new_relic/agent/transaction_sampler.rb +3 -7
- data/lib/new_relic/agent/worker_loop.rb +3 -11
- data/lib/new_relic/control.rb +0 -2
- data/lib/new_relic/control/class_methods.rb +8 -2
- data/lib/new_relic/control/frameworks/merb.rb +0 -6
- data/lib/new_relic/control/frameworks/rails.rb +8 -29
- data/lib/new_relic/control/frameworks/rails3.rb +8 -20
- data/lib/new_relic/control/frameworks/rails4.rb +23 -0
- data/lib/new_relic/control/frameworks/ruby.rb +1 -22
- data/lib/new_relic/control/instance_methods.rb +12 -34
- data/lib/new_relic/control/instrumentation.rb +7 -12
- data/lib/new_relic/control/server_methods.rb +5 -8
- data/lib/new_relic/delayed_job_injection.rb +1 -1
- data/lib/new_relic/local_environment.rb +30 -64
- data/lib/new_relic/metric_data.rb +1 -1
- data/lib/new_relic/metric_spec.rb +1 -1
- data/lib/new_relic/noticed_error.rb +1 -1
- data/lib/new_relic/rack/browser_monitoring.rb +5 -5
- data/lib/new_relic/stats.rb +9 -7
- data/lib/new_relic/transaction_sample.rb +2 -7
- data/lib/new_relic/version.rb +1 -1
- data/lib/newrelic_rpm.rb +1 -1
- data/newrelic_rpm.gemspec.erb +15 -17
- data/test/config/newrelic.yml +1 -1
- data/test/config/test_control.rb +18 -18
- data/test/fixtures/gemspec_no_build.rb +0 -2
- data/test/fixtures/gemspec_with_build.rb +0 -2
- data/test/fixtures/gemspec_with_build_and_stage.rb +0 -2
- data/test/multiverse/README.md +3 -8
- data/test/multiverse/suites/agent_only/Envfile +1 -0
- data/test/multiverse/suites/agent_only/audit_log_test.rb +99 -0
- data/test/multiverse/suites/agent_only/marshaling_test.rb +1 -1
- data/test/multiverse/suites/config_file_loading/Envfile +7 -0
- data/test/multiverse/suites/config_file_loading/config_file_loading_test.rb +106 -0
- data/test/multiverse/suites/logging/Envfile +4 -0
- data/test/multiverse/suites/logging/config/newrelic.yml +22 -0
- data/test/multiverse/suites/logging/logging_test.rb +143 -0
- data/test/multiverse/suites/no_load/config/newrelic.yml +1 -2
- data/test/multiverse/suites/rum_auto_instrumentation/sanity_test.rb +0 -13
- data/test/new_relic/agent/agent/connect_test.rb +30 -92
- data/test/new_relic/agent/agent/start_test.rb +4 -84
- data/test/new_relic/agent/agent/start_worker_thread_test.rb +8 -43
- data/test/new_relic/agent/agent_logger_test.rb +153 -0
- data/test/new_relic/agent/agent_test.rb +10 -9
- data/test/new_relic/agent/audit_logger_test.rb +105 -0
- data/test/new_relic/agent/browser_monitoring_test.rb +2 -1
- data/test/new_relic/agent/busy_calculator_test.rb +7 -0
- data/test/new_relic/agent/configuration/environment_source_test.rb +25 -20
- data/test/new_relic/agent/configuration/manager_test.rb +59 -4
- data/test/new_relic/agent/configuration/yaml_source_test.rb +20 -1
- data/test/new_relic/agent/cross_process_monitoring_test.rb +77 -0
- data/test/new_relic/agent/database_test.rb +0 -11
- data/test/new_relic/agent/error_collector/notice_error_test.rb +1 -3
- data/test/new_relic/agent/error_collector_test.rb +11 -7
- data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +39 -19
- data/test/new_relic/agent/instrumentation/browser_monitoring_timings_test.rb +39 -0
- data/test/new_relic/agent/instrumentation/metric_frame/pop_test.rb +1 -1
- data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +0 -6
- data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +3 -15
- data/test/new_relic/agent/new_relic_service_test.rb +48 -8
- data/test/new_relic/agent/pipe_channel_manager_test.rb +1 -1
- data/test/new_relic/agent/sql_sampler_test.rb +1 -1
- data/test/new_relic/agent/thread_profiler_test.rb +46 -45
- data/test/new_relic/agent/thread_test.rb +13 -0
- data/test/new_relic/agent/transaction_sample_builder_test.rb +1 -1
- data/test/new_relic/agent/worker_loop_test.rb +4 -9
- data/test/new_relic/agent_test.rb +6 -9
- data/test/new_relic/control/class_methods_test.rb +0 -18
- data/test/new_relic/control_test.rb +6 -9
- data/test/new_relic/dispatcher_test.rb +54 -0
- data/test/new_relic/fake_collector.rb +15 -14
- data/test/new_relic/fake_service.rb +4 -1
- data/test/new_relic/fakes_sending_data.rb +30 -0
- data/test/new_relic/framework_test.rb +53 -0
- data/test/new_relic/local_environment_test.rb +5 -2
- data/test/new_relic/rack/browser_monitoring_test.rb +2 -1
- data/test/new_relic/rack/developer_mode_test.rb +1 -1
- data/test/new_relic/stats_test.rb +10 -0
- data/test/new_relic/transaction_sample_test.rb +2 -2
- data/test/script/ci.sh +1 -1
- data/test/test_helper.rb +23 -0
- data/ui/views/newrelic/file/images/arrow-close.png +0 -0
- data/ui/views/newrelic/file/images/arrow-open.png +0 -0
- data/ui/views/newrelic/file/images/blue_bar.gif +0 -0
- data/ui/views/newrelic/file/images/file_icon.png +0 -0
- data/ui/views/newrelic/file/images/gray_bar.gif +0 -0
- metadata +47 -41
- data/InstallationNotes.md +0 -15
- data/lib/new_relic/control/logging_methods.rb +0 -125
- data/test/multiverse/Rakefile +0 -17
- data/test/multiverse/suites/rum_auto_instrumentation/problem_response.html +0 -422
- data/test/new_relic/control/logging_methods_test.rb +0 -211
@@ -0,0 +1,54 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__),'..', 'test_helper'))
|
2
|
+
|
3
|
+
# Test logic around detecting or configuring dispatcher
|
4
|
+
class DispatcherTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
NewRelic::Agent.shutdown
|
8
|
+
NewRelic::Agent.reset_config
|
9
|
+
end
|
10
|
+
|
11
|
+
def assert_dispatcher_reported_to_environment_report(dispatcher)
|
12
|
+
NewRelic::Control.instance.local_env.gather_environment_info
|
13
|
+
key, value = NewRelic::Control.instance.local_env.snapshot.detect do |(k, v)|
|
14
|
+
k == "Dispatcher"
|
15
|
+
end
|
16
|
+
assert_equal dispatcher.to_s, value
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_detects_dispatcher_via_loaded_libraries
|
20
|
+
class << self
|
21
|
+
module ::PhusionPassenger
|
22
|
+
end
|
23
|
+
end
|
24
|
+
assert_equal :passenger, NewRelic::Agent.config[:dispatcher]
|
25
|
+
assert_dispatcher_reported_to_environment_report :passenger
|
26
|
+
ensure
|
27
|
+
Object.send(:remove_const, :PhusionPassenger)
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_detects_dispatcher_via_ENV_NEW_RELIC_DISPATCHER
|
31
|
+
ENV['NEW_RELIC_DISPATCHER'] = "foobared"
|
32
|
+
NewRelic::Agent.reset_config
|
33
|
+
assert_equal :foobared, NewRelic::Agent.config[:dispatcher]
|
34
|
+
assert_dispatcher_reported_to_environment_report :foobared
|
35
|
+
ensure
|
36
|
+
ENV['NEW_RELIC_DISPATCHER'] = nil
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_detects_dispatcher_via_ENV_NEWRELIC_DISPATCHER
|
40
|
+
ENV['NEWRELIC_DISPATCHER'] = "bazbang"
|
41
|
+
NewRelic::Agent.reset_config
|
42
|
+
assert_equal :bazbang, NewRelic::Agent.config[:dispatcher]
|
43
|
+
assert_dispatcher_reported_to_environment_report :bazbang
|
44
|
+
ensure
|
45
|
+
ENV['NEWRELIC_DISPATCHER'] = nil
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_detects_dispatcher_based_on_arguments_to_manual_start
|
49
|
+
NewRelic::Agent.manual_start(:dispatcher => :resque)
|
50
|
+
assert_equal :resque, NewRelic::Agent.config[:dispatcher]
|
51
|
+
assert_dispatcher_reported_to_environment_report :resque
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -4,11 +4,16 @@ require 'uri'
|
|
4
4
|
require 'socket'
|
5
5
|
require 'timeout'
|
6
6
|
require 'ostruct'
|
7
|
+
require File.join(File.dirname(__FILE__), 'fakes_sending_data')
|
8
|
+
|
9
|
+
require 'json' if RUBY_VERSION >= '1.9'
|
7
10
|
|
8
11
|
module NewRelic
|
9
12
|
class FakeCollector
|
10
13
|
attr_accessor :agent_data, :mock
|
11
14
|
|
15
|
+
include FakesSendingData
|
16
|
+
|
12
17
|
def initialize
|
13
18
|
@id_counter = 0
|
14
19
|
@base_expectations = {
|
@@ -34,9 +39,10 @@ module NewRelic
|
|
34
39
|
uri = URI.parse(req.url)
|
35
40
|
if uri.path =~ /agent_listener\/\d+\/.+\/(\w+)/
|
36
41
|
method = $1
|
42
|
+
format = json_format?(uri) && RUBY_VERSION >= '1.9' ? :json : :pruby
|
37
43
|
if @mock.keys.include? method
|
38
44
|
res.status = @mock[method][0]
|
39
|
-
if
|
45
|
+
if format == :json
|
40
46
|
res.write JSON.dump(@mock[method][1])
|
41
47
|
else
|
42
48
|
res.write Marshal.dump(@mock[method][1])
|
@@ -47,25 +53,20 @@ module NewRelic
|
|
47
53
|
end
|
48
54
|
run_id = uri.query =~ /run_id=(\d+)/ ? $1 : nil
|
49
55
|
req.body.rewind
|
50
|
-
|
51
|
-
|
52
|
-
JSON.load(req.body.read)
|
56
|
+
|
57
|
+
body = if format == :json
|
58
|
+
body = JSON.load(req.body.read)
|
53
59
|
else
|
54
|
-
Marshal.load(req.body.read)
|
60
|
+
body = Marshal.load(req.body.read)
|
55
61
|
end
|
56
|
-
@agent_data << OpenStruct.new(:action
|
57
|
-
:body
|
58
|
-
:run_id
|
62
|
+
@agent_data << OpenStruct.new(:action => method,
|
63
|
+
:body => body,
|
64
|
+
:run_id => run_id,
|
65
|
+
:format => format)
|
59
66
|
end
|
60
67
|
res.finish
|
61
68
|
end
|
62
69
|
|
63
|
-
def calls_for(method)
|
64
|
-
@agent_data. \
|
65
|
-
select { |d| d.action == method }. \
|
66
|
-
map { |d| d.body }
|
67
|
-
end
|
68
|
-
|
69
70
|
def json_format?(uri)
|
70
71
|
uri.query && uri.query.include?('marshal_format=json')
|
71
72
|
end
|
@@ -1,9 +1,12 @@
|
|
1
1
|
require 'ostruct'
|
2
|
+
require File.join(File.dirname(__FILE__), 'fakes_sending_data')
|
2
3
|
|
3
4
|
module NewRelic
|
4
5
|
class FakeService
|
5
6
|
attr_accessor :request_timeout, :agent_id, :agent_data, :collector, :mock
|
6
|
-
|
7
|
+
|
8
|
+
include FakesSendingData
|
9
|
+
|
7
10
|
def initialize
|
8
11
|
@agent_data = []
|
9
12
|
@supported_methods = [ :connect, :metric_data, :transaction_sample_data,
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module NewRelic
|
2
|
+
module FakesSendingData
|
3
|
+
def calls_for(method)
|
4
|
+
@agent_data. \
|
5
|
+
select { |d| d.action == method }. \
|
6
|
+
map { |d| d.body }
|
7
|
+
end
|
8
|
+
|
9
|
+
# Unpeel the inner layers of encoding applied by the JSON marshaller.
|
10
|
+
# I'm sorry.
|
11
|
+
def unpack_inner_blobs(req)
|
12
|
+
body = req.body
|
13
|
+
if req.format == :json
|
14
|
+
case req.action
|
15
|
+
when 'profile_data' then
|
16
|
+
body[0][4] = unpack(body[0][4])
|
17
|
+
when 'sql_trace_data' then
|
18
|
+
body[0][0][9] = unpack(body[0][0][9])
|
19
|
+
when 'transaction_sample_data' then
|
20
|
+
body[4] = unpack(body[4])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
body
|
24
|
+
end
|
25
|
+
|
26
|
+
def unpack(blob)
|
27
|
+
JSON.load(Zlib::Inflate.inflate(Base64.decode64(blob)))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__),'..', 'test_helper'))
|
2
|
+
|
3
|
+
# Test logic around detecting or configuring framework
|
4
|
+
class FrameworkTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
|
8
|
+
# muck with this constant which forces the agent to load the
|
9
|
+
# NewRelic::Control::Frameworks::Test control so we can test the logic used
|
10
|
+
# to load the appropriate control object.
|
11
|
+
@old_newrelic_test_const = ::NewRelic::TEST
|
12
|
+
::NewRelic.send(:remove_const, :TEST)
|
13
|
+
|
14
|
+
NewRelic::Agent.shutdown
|
15
|
+
NewRelic::Agent.reset_config
|
16
|
+
|
17
|
+
# don't bomb out trying to load frameworks that don't exist.
|
18
|
+
NewRelic::Control.stubs(:new_instance).returns(stub :init_plugin => nil)
|
19
|
+
end
|
20
|
+
|
21
|
+
def teardown
|
22
|
+
# Put things back how we found them
|
23
|
+
::NewRelic.send(:const_set, :TEST, @old_newrelic_test_const)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_detects_framework_via_loaded_libraries
|
27
|
+
class << self
|
28
|
+
module ::Merb
|
29
|
+
module Plugins
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
assert_equal :merb, NewRelic::Agent.config[:framework]
|
34
|
+
ensure
|
35
|
+
Object.send(:remove_const, :Merb)
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_detects_framework_via_ENV_NEW_RELIC_FRAMEWORK
|
39
|
+
ENV['NEW_RELIC_FRAMEWORK'] = "foobared"
|
40
|
+
NewRelic::Agent.reset_config
|
41
|
+
assert_equal :foobared, NewRelic::Agent.config[:framework]
|
42
|
+
ensure
|
43
|
+
ENV['NEW_RELIC_FRAMEWORK'] = nil
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_detects_framework_via_ENV_NEWRELIC_FRAMEWORK
|
47
|
+
ENV['NEWRELIC_FRAMEWORK'] = "bazbang"
|
48
|
+
NewRelic::Agent.reset_config
|
49
|
+
assert_equal :bazbang, NewRelic::Agent.config[:framework]
|
50
|
+
ensure
|
51
|
+
ENV['NEWRELIC_FRAMEWORK'] = nil
|
52
|
+
end
|
53
|
+
end
|
@@ -31,16 +31,19 @@ class NewRelic::LocalEnvironmentTest < Test::Unit::TestCase
|
|
31
31
|
module ::PhusionPassenger
|
32
32
|
end
|
33
33
|
end
|
34
|
+
NewRelic::Agent.reset_config
|
34
35
|
e = NewRelic::LocalEnvironment.new
|
35
|
-
assert_equal :passenger, e.
|
36
|
+
assert_equal :passenger, e.discovered_dispatcher
|
37
|
+
assert_equal :passenger, NewRelic::Agent.config[:dispatcher]
|
36
38
|
assert_nil e.dispatcher_instance_id, "dispatcher instance id should be nil: #{e.dispatcher_instance_id}"
|
37
39
|
|
38
40
|
with_config(:app_name => 'myapp') do
|
39
41
|
e = NewRelic::LocalEnvironment.new
|
40
|
-
assert_equal :passenger, e.
|
42
|
+
assert_equal :passenger, e.discovered_dispatcher
|
41
43
|
assert_nil e.dispatcher_instance_id
|
42
44
|
end
|
43
45
|
|
46
|
+
ensure
|
44
47
|
Object.send(:remove_const, :PhusionPassenger)
|
45
48
|
end
|
46
49
|
|
@@ -51,7 +51,8 @@ EOL
|
|
51
51
|
:beacon => 'beacon',
|
52
52
|
:application_id => 5,
|
53
53
|
:'rum.enabled' => true,
|
54
|
-
:episodes_file => 'this_is_my_file'
|
54
|
+
:episodes_file => 'this_is_my_file',
|
55
|
+
:license_key => 'a' * 40
|
55
56
|
}
|
56
57
|
NewRelic::Agent.config.apply_config(@config)
|
57
58
|
NewRelic::Agent.manual_start
|
@@ -16,7 +16,7 @@ class DeveloperModeTest < Test::Unit::TestCase
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def setup
|
19
|
-
@test_config = {
|
19
|
+
@test_config = { :developer_mode => true }
|
20
20
|
NewRelic::Agent.config.apply_config(@test_config)
|
21
21
|
@sampler = NewRelic::Agent::TransactionSampler.new
|
22
22
|
run_sample_trace_on(@sampler, '/here')
|
@@ -399,6 +399,16 @@ class NewRelic::StatsTest < Test::Unit::TestCase
|
|
399
399
|
assert_in_delta(s3.standard_deviation, 4.743, 0.01)
|
400
400
|
end
|
401
401
|
|
402
|
+
if RUBY_VERSION >= '1.9'
|
403
|
+
def test_to_json_enforces_float_values
|
404
|
+
s1 = NewRelic::MethodTraceStats.new
|
405
|
+
s1.trace_call 3.to_r
|
406
|
+
s1.trace_call 7.to_r
|
407
|
+
|
408
|
+
assert_equal 3.0, JSON.load(s1.to_json)['min_call_time']
|
409
|
+
end
|
410
|
+
end
|
411
|
+
|
402
412
|
private
|
403
413
|
def validate (stats, count, total, min, max, exclusive = nil)
|
404
414
|
assert_equal stats.call_count, count
|
@@ -5,7 +5,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
|
|
5
5
|
::SQL_STATEMENT = "SELECT * from sandwiches"
|
6
6
|
|
7
7
|
def setup
|
8
|
-
@test_config = {
|
8
|
+
@test_config = { :developer_mode => true }
|
9
9
|
NewRelic::Agent.config.apply_config(@test_config)
|
10
10
|
@connection_stub = Mocha::Mockery.instance.named_mock('connection')
|
11
11
|
@connection_stub.stubs(:execute).returns([['QUERY RESULT']])
|
@@ -213,7 +213,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
|
|
213
213
|
trace_tree,
|
214
214
|
@t.guid, nil, !!@t.force_persist]
|
215
215
|
|
216
|
-
assert_equal expected_array, @t.to_collector_array(marshaller)
|
216
|
+
assert_equal expected_array, @t.to_collector_array(marshaller.default_encoder)
|
217
217
|
end
|
218
218
|
|
219
219
|
def compress(string)
|
data/test/script/ci.sh
CHANGED
@@ -144,7 +144,7 @@ else
|
|
144
144
|
fi
|
145
145
|
|
146
146
|
if [ "x$RUBY" == "x1.8.6" ]; then
|
147
|
-
# Bundler
|
147
|
+
# Bundler 1.1 dropped support for ruby 1.8.6
|
148
148
|
bundle -h > /dev/null || gem install bundler -v'~>1.0.0' --no-rdoc --no-ri
|
149
149
|
else
|
150
150
|
bundle -h > /dev/null || gem install bundler --no-rdoc --no-ri
|
data/test/test_helper.rb
CHANGED
@@ -137,6 +137,29 @@ def with_config(config_hash, level=0)
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
+
# Need to be a bit sloppy when testing against the logging--let everything
|
141
|
+
# through, but check we (at least) get our particular message we care about
|
142
|
+
def expects_logging(level, *with_params)
|
143
|
+
::NewRelic::Agent.logger.stubs(level)
|
144
|
+
::NewRelic::Agent.logger.expects(level).with(*with_params).once
|
145
|
+
end
|
146
|
+
|
147
|
+
# Similarly, have to be specific about the message we "never" expect...
|
148
|
+
def expects_no_logging(level, *with_params)
|
149
|
+
::NewRelic::Agent.logger.stubs(level)
|
150
|
+
::NewRelic::Agent.logger.expects(level).with(*with_params).never
|
151
|
+
end
|
152
|
+
|
153
|
+
# Sometimes need to test cases where we muddle with the global logger
|
154
|
+
# If so, use this method to ensure it gets restored after we're done
|
155
|
+
def without_logger
|
156
|
+
logger = ::NewRelic::Agent.logger
|
157
|
+
::NewRelic::Agent.logger = nil
|
158
|
+
yield
|
159
|
+
ensure
|
160
|
+
::NewRelic::Agent.logger = logger
|
161
|
+
end
|
162
|
+
|
140
163
|
module NewRelic
|
141
164
|
def self.fixture_path(name)
|
142
165
|
File.join(File.dirname(__FILE__), 'fixtures', name)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
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.5.
|
5
|
-
prerelease:
|
4
|
+
version: 3.5.5.38
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jason Clark
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-01-
|
15
|
+
date: 2013-01-07 00:00:00.000000000 Z
|
16
16
|
dependencies: []
|
17
17
|
description: ! 'New Relic is a performance management system, developed by New Relic,
|
18
18
|
|
@@ -46,7 +46,6 @@ files:
|
|
46
46
|
- CHANGELOG
|
47
47
|
- GUIDELINES_FOR_CONTRIBUTING.md
|
48
48
|
- Gemfile
|
49
|
-
- InstallationNotes.md
|
50
49
|
- LICENSE
|
51
50
|
- README.md
|
52
51
|
- Rakefile
|
@@ -64,6 +63,8 @@ files:
|
|
64
63
|
- lib/conditional_vendored_metric_parser.rb
|
65
64
|
- lib/new_relic/agent.rb
|
66
65
|
- lib/new_relic/agent/agent.rb
|
66
|
+
- lib/new_relic/agent/agent_logger.rb
|
67
|
+
- lib/new_relic/agent/audit_logger.rb
|
67
68
|
- lib/new_relic/agent/beacon_configuration.rb
|
68
69
|
- lib/new_relic/agent/browser_monitoring.rb
|
69
70
|
- lib/new_relic/agent/busy_calculator.rb
|
@@ -72,8 +73,10 @@ files:
|
|
72
73
|
- lib/new_relic/agent/configuration/defaults.rb
|
73
74
|
- lib/new_relic/agent/configuration/environment_source.rb
|
74
75
|
- lib/new_relic/agent/configuration/manager.rb
|
76
|
+
- lib/new_relic/agent/configuration/mask_defaults.rb
|
75
77
|
- lib/new_relic/agent/configuration/server_source.rb
|
76
78
|
- lib/new_relic/agent/configuration/yaml_source.rb
|
79
|
+
- lib/new_relic/agent/cross_process_monitoring.rb
|
77
80
|
- lib/new_relic/agent/database.rb
|
78
81
|
- lib/new_relic/agent/error_collector.rb
|
79
82
|
- lib/new_relic/agent/instrumentation.rb
|
@@ -81,6 +84,7 @@ files:
|
|
81
84
|
- lib/new_relic/agent/instrumentation/active_record.rb
|
82
85
|
- lib/new_relic/agent/instrumentation/acts_as_solr.rb
|
83
86
|
- lib/new_relic/agent/instrumentation/authlogic.rb
|
87
|
+
- lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb
|
84
88
|
- lib/new_relic/agent/instrumentation/controller_instrumentation.rb
|
85
89
|
- lib/new_relic/agent/instrumentation/data_mapper.rb
|
86
90
|
- lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb
|
@@ -135,11 +139,11 @@ files:
|
|
135
139
|
- lib/new_relic/control/frameworks/merb.rb
|
136
140
|
- lib/new_relic/control/frameworks/rails.rb
|
137
141
|
- lib/new_relic/control/frameworks/rails3.rb
|
142
|
+
- lib/new_relic/control/frameworks/rails4.rb
|
138
143
|
- lib/new_relic/control/frameworks/ruby.rb
|
139
144
|
- lib/new_relic/control/frameworks/sinatra.rb
|
140
145
|
- lib/new_relic/control/instance_methods.rb
|
141
146
|
- lib/new_relic/control/instrumentation.rb
|
142
|
-
- lib/new_relic/control/logging_methods.rb
|
143
147
|
- lib/new_relic/control/profiling.rb
|
144
148
|
- lib/new_relic/control/server_methods.rb
|
145
149
|
- lib/new_relic/delayed_job_injection.rb
|
@@ -184,7 +188,6 @@ files:
|
|
184
188
|
- test/intentional_fail.rb
|
185
189
|
- test/multiverse/.gitignore
|
186
190
|
- test/multiverse/README.md
|
187
|
-
- test/multiverse/Rakefile
|
188
191
|
- test/multiverse/lib/multiverse/color.rb
|
189
192
|
- test/multiverse/lib/multiverse/envfile.rb
|
190
193
|
- test/multiverse/lib/multiverse/environment.rb
|
@@ -198,6 +201,7 @@ files:
|
|
198
201
|
- test/multiverse/suites/active_record/config/newrelic.yml
|
199
202
|
- test/multiverse/suites/active_record/encoding_test.rb
|
200
203
|
- test/multiverse/suites/agent_only/Envfile
|
204
|
+
- test/multiverse/suites/agent_only/audit_log_test.rb
|
201
205
|
- test/multiverse/suites/agent_only/config/newrelic.yml
|
202
206
|
- test/multiverse/suites/agent_only/http_response_code_test.rb
|
203
207
|
- test/multiverse/suites/agent_only/marshaling_test.rb
|
@@ -207,9 +211,14 @@ files:
|
|
207
211
|
- test/multiverse/suites/agent_only/test_trace_method_with_punctuation.rb
|
208
212
|
- test/multiverse/suites/agent_only/test_trace_transaction_with_punctuation.rb
|
209
213
|
- test/multiverse/suites/agent_only/thread_profiling_test.rb
|
214
|
+
- test/multiverse/suites/config_file_loading/Envfile
|
215
|
+
- test/multiverse/suites/config_file_loading/config_file_loading_test.rb
|
210
216
|
- test/multiverse/suites/datamapper/Envfile
|
211
217
|
- test/multiverse/suites/datamapper/config/newrelic.yml
|
212
218
|
- test/multiverse/suites/datamapper/encoding_test.rb
|
219
|
+
- test/multiverse/suites/logging/Envfile
|
220
|
+
- test/multiverse/suites/logging/config/newrelic.yml
|
221
|
+
- test/multiverse/suites/logging/logging_test.rb
|
213
222
|
- test/multiverse/suites/monitor_mode_false/Envfile
|
214
223
|
- test/multiverse/suites/monitor_mode_false/config/newrelic.yml
|
215
224
|
- test/multiverse/suites/monitor_mode_false/no_dns_resolv.rb
|
@@ -242,7 +251,6 @@ files:
|
|
242
251
|
- test/multiverse/suites/resque/instrumentation_test.rb
|
243
252
|
- test/multiverse/suites/rum_auto_instrumentation/Envfile
|
244
253
|
- test/multiverse/suites/rum_auto_instrumentation/config/newrelic.yml
|
245
|
-
- test/multiverse/suites/rum_auto_instrumentation/problem_response.html
|
246
254
|
- test/multiverse/suites/rum_auto_instrumentation/responses/worst_case_small.html
|
247
255
|
- test/multiverse/suites/rum_auto_instrumentation/sanity_test.rb
|
248
256
|
- test/multiverse/suites/sinatra/Envfile
|
@@ -266,10 +274,12 @@ files:
|
|
266
274
|
- test/new_relic/agent/agent/connect_test.rb
|
267
275
|
- test/new_relic/agent/agent/start_test.rb
|
268
276
|
- test/new_relic/agent/agent/start_worker_thread_test.rb
|
277
|
+
- test/new_relic/agent/agent_logger_test.rb
|
269
278
|
- test/new_relic/agent/agent_test.rb
|
270
279
|
- test/new_relic/agent/agent_test_controller.rb
|
271
280
|
- test/new_relic/agent/agent_test_controller_test.rb
|
272
281
|
- test/new_relic/agent/apdex_from_server_test.rb
|
282
|
+
- test/new_relic/agent/audit_logger_test.rb
|
273
283
|
- test/new_relic/agent/beacon_configuration_test.rb
|
274
284
|
- test/new_relic/agent/browser_monitoring_test.rb
|
275
285
|
- test/new_relic/agent/busy_calculator_test.rb
|
@@ -277,10 +287,12 @@ files:
|
|
277
287
|
- test/new_relic/agent/configuration/manager_test.rb
|
278
288
|
- test/new_relic/agent/configuration/server_source_test.rb
|
279
289
|
- test/new_relic/agent/configuration/yaml_source_test.rb
|
290
|
+
- test/new_relic/agent/cross_process_monitoring_test.rb
|
280
291
|
- test/new_relic/agent/database_test.rb
|
281
292
|
- test/new_relic/agent/error_collector/notice_error_test.rb
|
282
293
|
- test/new_relic/agent/error_collector_test.rb
|
283
294
|
- test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb
|
295
|
+
- test/new_relic/agent/instrumentation/browser_monitoring_timings_test.rb
|
284
296
|
- test/new_relic/agent/instrumentation/controller_instrumentation_test.rb
|
285
297
|
- test/new_relic/agent/instrumentation/instrumentation_test.rb
|
286
298
|
- test/new_relic/agent/instrumentation/metric_frame/pop_test.rb
|
@@ -318,11 +330,13 @@ files:
|
|
318
330
|
- test/new_relic/command/deployments_test.rb
|
319
331
|
- test/new_relic/control/class_methods_test.rb
|
320
332
|
- test/new_relic/control/frameworks/rails_test.rb
|
321
|
-
- test/new_relic/control/logging_methods_test.rb
|
322
333
|
- test/new_relic/control_test.rb
|
323
334
|
- test/new_relic/delayed_job_injection_test.rb
|
335
|
+
- test/new_relic/dispatcher_test.rb
|
324
336
|
- test/new_relic/fake_collector.rb
|
325
337
|
- test/new_relic/fake_service.rb
|
338
|
+
- test/new_relic/fakes_sending_data.rb
|
339
|
+
- test/new_relic/framework_test.rb
|
326
340
|
- test/new_relic/load_test.rb
|
327
341
|
- test/new_relic/local_environment_test.rb
|
328
342
|
- test/new_relic/metric_data_test.rb
|
@@ -433,39 +447,31 @@ files:
|
|
433
447
|
- newrelic_rpm.gemspec
|
434
448
|
homepage: http://www.github.com/newrelic/rpm
|
435
449
|
licenses: []
|
436
|
-
post_install_message: !
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
Please see http://github.com/newrelic/rpm/blob/master/CHANGELOG
|
462
|
-
|
463
|
-
for a complete description of the features and enhancements available
|
464
|
-
|
465
|
-
in this version of the Ruby Agent.
|
466
|
-
|
467
|
-
|
468
|
-
'
|
450
|
+
post_install_message: ! "\n# New Relic Ruby Agent Release Notes #\n\n## v3.5.5 ##\n\n
|
451
|
+
\ * Add thread profiling support\n\n Thread profiling performs statistical sampling
|
452
|
+
of backtraces of all threads\n within your Ruby processes. This feature requires
|
453
|
+
MRI >= 1.9.2, and is\n controlled via the New Relic web UI. JRuby support (in
|
454
|
+
1.9.x compat mode) is\n considered experimental, due to issues with JRuby's Thread#backtrace.\n\n
|
455
|
+
\ * Add audit logging capability\n\n The agent can now log all of the data it
|
456
|
+
sends to the New Relic servers to\n a special log file for human inspection.
|
457
|
+
This feature is off by default, and\n can be enabled by setting the audit_log.enabled
|
458
|
+
configuration key to true.\n You may also control the location of the audit log
|
459
|
+
with the audit_log.path key. \n\n * Use config system for dispatcher, framework,
|
460
|
+
and config file detection\n\n Several aspects of the agent's configuration were
|
461
|
+
not being handled by the\n configuration system. Detection/configuration of
|
462
|
+
the dispatcher (e.g. passenger,\n unicorn, resque), framework (e.g. rails3, sinatra),
|
463
|
+
and newrelic.yml\n location are now handled via the Agent environment, manual,
|
464
|
+
and default\n configuration sources.\n\n * Updates to logging across the agent\n\n
|
465
|
+
\ We've carefully reviewed the logging messages that the agent outputs, adding\n
|
466
|
+
\ details in some cases, and removing unnecessary clutter. We've also altered\n
|
467
|
+
\ the startup sequence to ensure that we don't spam STDOUT with messages\n during
|
468
|
+
initialization.\n\n * Fix passing environment to manual_start()\n\n Thanks to
|
469
|
+
Justin Hannus. The :env key, when passed to Agent.manual_start,\n can again
|
470
|
+
be used to specify which section of newrelic.yml is loaded.\n\n * Rails 4 support\n\n
|
471
|
+
\ This release includes preliminary support for Rails 4 as of 4.0.0.beta.\n Rails
|
472
|
+
4 is still in development, but the agent should work as expected for\n people
|
473
|
+
who are experimenting with the beta.\n\n\nSee https://github.com/newrelic/rpm/blob/master/CHANGELOG
|
474
|
+
for a full list of\nchanges.\n"
|
469
475
|
rdoc_options:
|
470
476
|
- --line-numbers
|
471
477
|
- --inline-source
|