newrelic_rpm 3.4.1 → 3.4.2.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of newrelic_rpm might be problematic. Click here for more details.

Files changed (81) hide show
  1. data/CHANGELOG +7 -0
  2. data/ReleaseNotes.md +638 -0
  3. data/lib/new_relic/agent/agent.rb +44 -56
  4. data/lib/new_relic/agent/beacon_configuration.rb +1 -1
  5. data/lib/new_relic/agent/browser_monitoring.rb +80 -42
  6. data/lib/new_relic/agent/configuration/defaults.rb +75 -0
  7. data/lib/new_relic/agent/configuration/environment_source.rb +42 -0
  8. data/lib/new_relic/agent/configuration/manager.rb +100 -0
  9. data/lib/new_relic/agent/configuration/server_source.rb +24 -0
  10. data/lib/new_relic/agent/configuration/yaml_source.rb +61 -0
  11. data/lib/new_relic/agent/configuration.rb +48 -0
  12. data/lib/new_relic/agent/error_collector.rb +10 -14
  13. data/lib/new_relic/agent/instrumentation/active_record.rb +1 -5
  14. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +20 -4
  15. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +1 -1
  16. data/lib/new_relic/agent/instrumentation/memcache.rb +2 -2
  17. data/lib/new_relic/agent/instrumentation/metric_frame.rb +1 -1
  18. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +3 -3
  19. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +2 -2
  20. data/lib/new_relic/agent/instrumentation/resque.rb +1 -1
  21. data/lib/new_relic/agent/method_tracer.rb +1 -1
  22. data/lib/new_relic/agent/new_relic_service.rb +18 -9
  23. data/lib/new_relic/agent/pipe_channel_manager.rb +5 -6
  24. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +2 -5
  25. data/lib/new_relic/agent/sql_sampler.rb +11 -35
  26. data/lib/new_relic/agent/stats_engine/transactions.rb +2 -2
  27. data/lib/new_relic/agent/transaction_info.rb +24 -4
  28. data/lib/new_relic/agent/transaction_sample_builder.rb +2 -3
  29. data/lib/new_relic/agent/transaction_sampler.rb +9 -16
  30. data/lib/new_relic/agent.rb +4 -1
  31. data/lib/new_relic/collection_helper.rb +1 -1
  32. data/lib/new_relic/commands/deployments.rb +5 -3
  33. data/lib/new_relic/control/class_methods.rb +2 -3
  34. data/lib/new_relic/control/frameworks/rails.rb +8 -8
  35. data/lib/new_relic/control/frameworks/ruby.rb +2 -2
  36. data/lib/new_relic/control/instance_methods.rb +26 -32
  37. data/lib/new_relic/control/logging_methods.rb +5 -23
  38. data/lib/new_relic/control/server_methods.rb +11 -18
  39. data/lib/new_relic/control.rb +0 -1
  40. data/lib/new_relic/delayed_job_injection.rb +1 -1
  41. data/lib/new_relic/language_support.rb +8 -0
  42. data/lib/new_relic/noticed_error.rb +1 -1
  43. data/lib/new_relic/rack/browser_monitoring.rb +18 -6
  44. data/lib/new_relic/version.rb +2 -2
  45. data/newrelic.yml +0 -4
  46. data/newrelic_rpm.gemspec +16 -6
  47. data/test/config/newrelic.yml +3 -2
  48. data/test/new_relic/agent/agent/connect_test.rb +88 -83
  49. data/test/new_relic/agent/agent/start_test.rb +75 -80
  50. data/test/new_relic/agent/agent/start_worker_thread_test.rb +18 -18
  51. data/test/new_relic/agent/beacon_configuration_test.rb +13 -11
  52. data/test/new_relic/agent/browser_monitoring_test.rb +69 -14
  53. data/test/new_relic/agent/configuration/environment_source_test.rb +58 -0
  54. data/test/new_relic/agent/configuration/manager_test.rb +120 -0
  55. data/test/new_relic/agent/configuration/server_source_test.rb +28 -0
  56. data/test/new_relic/agent/configuration/yaml_source_test.rb +56 -0
  57. data/test/new_relic/agent/error_collector/notice_error_test.rb +63 -50
  58. data/test/new_relic/agent/error_collector_test.rb +10 -12
  59. data/test/new_relic/agent/new_relic_service_test.rb +11 -3
  60. data/test/new_relic/agent/pipe_channel_manager_test.rb +19 -16
  61. data/test/new_relic/agent/rpm_agent_test.rb +21 -19
  62. data/test/new_relic/agent/sql_sampler_test.rb +55 -56
  63. data/test/new_relic/agent/transaction_info_test.rb +45 -4
  64. data/test/new_relic/agent/transaction_sampler_test.rb +48 -44
  65. data/test/new_relic/agent_test.rb +68 -41
  66. data/test/new_relic/collection_helper_test.rb +7 -8
  67. data/test/new_relic/command/deployments_test.rb +12 -1
  68. data/test/new_relic/control/frameworks/rails_test.rb +26 -0
  69. data/test/new_relic/control/logging_methods_test.rb +77 -52
  70. data/test/new_relic/control_test.rb +103 -126
  71. data/test/new_relic/local_environment_test.rb +4 -6
  72. data/test/new_relic/rack/browser_monitoring_test.rb +4 -4
  73. data/test/new_relic/rack/developer_mode_test.rb +13 -7
  74. data/test/new_relic/transaction_sample_test.rb +8 -2
  75. data/test/script/build_test_gem.sh +9 -3
  76. data/test/script/ci.sh +13 -3
  77. data/test/test_helper.rb +9 -2
  78. data/ui/helpers/developer_mode_helper.rb +2 -7
  79. metadata +26 -11
  80. data/lib/new_relic/control/configuration.rb +0 -206
  81. data/test/new_relic/control/configuration_test.rb +0 -77
@@ -1,77 +0,0 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__),'/../../test_helper'))
2
-
3
- class NewRelic::Control::ConfigurationTest < Test::Unit::TestCase
4
- require 'new_relic/control/configuration'
5
- include NewRelic::Control::Configuration
6
-
7
- def setup
8
- # The log stuff is memoized so let's clear it each time.
9
- NewRelic::Control.instance.instance_variable_set '@log_path', nil
10
- NewRelic::Control.instance.instance_variable_set '@log_file', nil
11
- @root = ::Rails::VERSION::MAJOR == 3 ? Rails.root : RAILS_ROOT
12
- end
13
-
14
- def teardown
15
- NewRelic::Control.instance.settings.delete('log_file_path')
16
- end
17
-
18
- def test_license_key_defaults_to_env_variable
19
- ENV['NEWRELIC_LICENSE_KEY'] = nil
20
- self.expects(:fetch).with('license_key', nil)
21
- license_key
22
-
23
- ENV['NEWRELIC_LICENSE_KEY'] = "a string"
24
- self.expects(:fetch).with('license_key', 'a string')
25
- license_key
26
- end
27
-
28
- def test_log_path_uses_default_if_not_set
29
- NewRelic::Control.instance.setup_log
30
- assert_equal(File.expand_path("log/newrelic_agent.log"),
31
- NewRelic::Control.instance.log_file)
32
- end
33
-
34
- def test_log_file_path_uses_given_value
35
- Dir.stubs(:mkdir).returns(true)
36
- NewRelic::Control.instance['log_file_path'] = 'lerg'
37
- NewRelic::Control.instance.setup_log
38
- assert_match(/\/lerg\/newrelic_agent.log/,
39
- NewRelic::Control.instance.log_file)
40
- NewRelic::Control.instance.settings.delete('log_file_path') # = nil
41
- end
42
-
43
- def test_server_side_config_ignores_yaml
44
- settings.merge! 'ssl' => false, 'transaction_tracer' => {'enabled' => true, 'stack_trace_threshold' => 1.0}, 'error_collector' => {'enabled' => true, 'ignore_errors' => 'ActiveRecord::RecordNotFound'}, 'capture_params' => false
45
- merge_server_side_config 'transaction_tracer.enabled' => false, 'error_collector.enabled' => false
46
- assert_equal({'ssl' => false, 'transaction_tracer' => {'enabled' => false}, 'error_collector' => {'enabled' => false}}, settings)
47
- end
48
-
49
- def test_install_browser_monitoring
50
- require(File.expand_path(File.join(File.dirname(__FILE__),
51
- '/../../../lib/new_relic/rack/browser_monitoring')))
52
- middleware = stub('middleware config')
53
- config = stub('rails config', :middleware => middleware)
54
- middleware.expects(:use).with(NewRelic::Rack::BrowserMonitoring)
55
- NewRelic::Control.instance['browser_monitoring'] = { 'auto_instrument' => true }
56
- NewRelic::Control.instance.instance_eval { @browser_monitoring_installed = false }
57
-
58
- NewRelic::Control.instance.install_browser_monitoring(config)
59
- end
60
-
61
- def test_install_browser_monitoring_should_not_install_when_not_configured
62
- middleware = stub('middleware config')
63
- config = stub('rails config', :middleware => middleware)
64
- middleware.expects(:use).never
65
- NewRelic::Control.instance['browser_monitoring'] = { 'auto_instrument' => false }
66
- NewRelic::Control.instance.instance_eval { @browser_monitoring_installed = false }
67
-
68
- NewRelic::Control.instance.install_browser_monitoring(config)
69
-
70
- NewRelic::Control.instance['browser_monitoring'] = { 'auto_instrument' => true }
71
- end
72
-
73
- def test_data_serialization_default_off
74
- DependencyDetection.send(:class_variable_set, '@@items', [])
75
- assert NewRelic::Control.instance.disable_serialization?
76
- end
77
- end