ghazel-newrelic_rpm 3.4.0.2 → 3.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. data/.gitignore +21 -0
  2. data/.project +23 -0
  3. data/.travis.yml +9 -0
  4. data/CHANGELOG +180 -1
  5. data/GUIDELINES_FOR_CONTRIBUTING.md +73 -0
  6. data/Gemfile +16 -0
  7. data/InstallationNotes.md +15 -0
  8. data/LICENSE +1 -1
  9. data/{README.rdoc → README.md} +71 -55
  10. data/Rakefile +54 -0
  11. data/config.dot +290 -0
  12. data/config/database.yml +5 -0
  13. data/init.rb +38 -0
  14. data/lib/new_relic/agent.rb +9 -4
  15. data/lib/new_relic/agent/agent.rb +189 -230
  16. data/lib/new_relic/agent/beacon_configuration.rb +34 -48
  17. data/lib/new_relic/agent/browser_monitoring.rb +108 -61
  18. data/lib/new_relic/agent/busy_calculator.rb +12 -4
  19. data/lib/new_relic/agent/configuration.rb +49 -0
  20. data/lib/new_relic/agent/configuration/defaults.rb +89 -0
  21. data/lib/new_relic/agent/configuration/environment_source.rb +56 -0
  22. data/lib/new_relic/agent/configuration/manager.rb +116 -0
  23. data/lib/new_relic/agent/configuration/server_source.rb +27 -0
  24. data/lib/new_relic/agent/configuration/yaml_source.rb +61 -0
  25. data/lib/new_relic/agent/database.rb +37 -22
  26. data/lib/new_relic/agent/error_collector.rb +47 -43
  27. data/lib/new_relic/agent/instrumentation/active_record.rb +1 -5
  28. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +27 -6
  29. data/lib/new_relic/agent/instrumentation/data_mapper.rb +2 -10
  30. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +1 -1
  31. data/lib/new_relic/agent/instrumentation/memcache.rb +2 -2
  32. data/lib/new_relic/agent/instrumentation/metric_frame.rb +4 -14
  33. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +4 -18
  34. data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
  35. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +3 -3
  36. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +2 -2
  37. data/lib/new_relic/agent/instrumentation/rails3/errors.rb +5 -1
  38. data/lib/new_relic/agent/instrumentation/resque.rb +1 -1
  39. data/lib/new_relic/agent/instrumentation/sinatra.rb +14 -10
  40. data/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb +4 -3
  41. data/lib/new_relic/agent/method_tracer.rb +5 -1
  42. data/lib/new_relic/agent/new_relic_service.rb +231 -61
  43. data/lib/new_relic/agent/pipe_channel_manager.rb +37 -23
  44. data/lib/new_relic/agent/pipe_service.rb +5 -1
  45. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +2 -5
  46. data/lib/new_relic/agent/samplers/memory_sampler.rb +2 -2
  47. data/lib/new_relic/agent/sql_sampler.rb +44 -68
  48. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +40 -24
  49. data/lib/new_relic/agent/stats_engine/metric_stats.rb +89 -14
  50. data/lib/new_relic/agent/stats_engine/samplers.rb +7 -3
  51. data/lib/new_relic/agent/stats_engine/transactions.rb +19 -11
  52. data/lib/new_relic/agent/thread.rb +27 -0
  53. data/lib/new_relic/agent/thread_profiler.rb +295 -0
  54. data/lib/new_relic/agent/transaction_info.rb +24 -4
  55. data/lib/new_relic/agent/transaction_sample_builder.rb +11 -11
  56. data/lib/new_relic/agent/transaction_sampler.rb +51 -61
  57. data/lib/new_relic/agent/worker_loop.rb +29 -15
  58. data/lib/new_relic/collection_helper.rb +1 -1
  59. data/lib/new_relic/commands/deployments.rb +19 -10
  60. data/lib/new_relic/control.rb +0 -1
  61. data/lib/new_relic/control/class_methods.rb +2 -3
  62. data/lib/new_relic/control/frameworks/rails.rb +24 -18
  63. data/lib/new_relic/control/frameworks/rails3.rb +18 -1
  64. data/lib/new_relic/control/frameworks/ruby.rb +2 -2
  65. data/lib/new_relic/control/instance_methods.rb +36 -53
  66. data/lib/new_relic/control/logging_methods.rb +5 -23
  67. data/lib/new_relic/control/server_methods.rb +11 -13
  68. data/lib/new_relic/delayed_job_injection.rb +1 -1
  69. data/lib/new_relic/helper.rb +13 -0
  70. data/lib/new_relic/language_support.rb +19 -22
  71. data/lib/new_relic/local_environment.rb +2 -3
  72. data/lib/new_relic/metric_data.rb +10 -2
  73. data/lib/new_relic/metric_spec.rb +6 -2
  74. data/lib/new_relic/noticed_error.rb +24 -9
  75. data/lib/new_relic/rack.rb +4 -0
  76. data/lib/new_relic/rack/browser_monitoring.rb +28 -10
  77. data/lib/new_relic/rack/developer_mode.rb +3 -0
  78. data/lib/new_relic/rack/error_collector.rb +56 -0
  79. data/lib/new_relic/transaction_sample.rb +23 -13
  80. data/lib/new_relic/transaction_sample/segment.rb +13 -15
  81. data/lib/new_relic/version.rb +3 -3
  82. data/lib/tasks/tests.rake +8 -8
  83. data/newrelic.yml +15 -32
  84. data/newrelic_rpm.gemspec +158 -38
  85. data/newrelic_rpm.gemspec.erb +55 -0
  86. data/test/config/newrelic.yml +3 -2
  87. data/test/intentional_fail.rb +10 -0
  88. data/test/multiverse/.gitignore +10 -0
  89. data/test/multiverse/README.md +90 -0
  90. data/test/multiverse/Rakefile +17 -0
  91. data/test/multiverse/lib/multiverse/color.rb +13 -0
  92. data/test/multiverse/lib/multiverse/envfile.rb +66 -0
  93. data/test/multiverse/lib/multiverse/environment.rb +16 -0
  94. data/test/multiverse/lib/multiverse/output_collector.rb +29 -0
  95. data/test/multiverse/lib/multiverse/runner.rb +44 -0
  96. data/test/multiverse/lib/multiverse/suite.rb +162 -0
  97. data/test/multiverse/script/run_one +3 -0
  98. data/test/multiverse/script/runner +9 -0
  99. data/test/multiverse/suites/active_record/Envfile +13 -0
  100. data/test/multiverse/suites/active_record/ar_method_aliasing.rb +94 -0
  101. data/test/multiverse/suites/active_record/config/newrelic.yml +22 -0
  102. data/test/multiverse/suites/active_record/encoding_test.rb +26 -0
  103. data/test/multiverse/suites/agent_only/Envfile +3 -0
  104. data/test/multiverse/suites/agent_only/config/newrelic.yml +22 -0
  105. data/test/multiverse/suites/agent_only/http_response_code_test.rb +53 -0
  106. data/test/multiverse/suites/agent_only/marshaling_test.rb +109 -0
  107. data/test/multiverse/suites/agent_only/method_visibility_test.rb +98 -0
  108. data/test/multiverse/suites/agent_only/pipe_manager_test.rb +33 -0
  109. data/test/multiverse/suites/agent_only/service_timeout_test.rb +29 -0
  110. data/test/multiverse/suites/agent_only/test_trace_method_with_punctuation.rb +30 -0
  111. data/test/multiverse/suites/agent_only/test_trace_transaction_with_punctuation.rb +32 -0
  112. data/test/multiverse/suites/agent_only/thread_profiling_test.rb +80 -0
  113. data/test/multiverse/suites/datamapper/Envfile +8 -0
  114. data/test/multiverse/suites/datamapper/config/newrelic.yml +22 -0
  115. data/test/multiverse/suites/datamapper/encoding_test.rb +36 -0
  116. data/test/multiverse/suites/monitor_mode_false/Envfile +2 -0
  117. data/test/multiverse/suites/monitor_mode_false/config/newrelic.yml +25 -0
  118. data/test/multiverse/suites/monitor_mode_false/no_dns_resolv.rb +29 -0
  119. data/test/multiverse/suites/no_load/Envfile +2 -0
  120. data/test/multiverse/suites/no_load/config/newrelic.yml +23 -0
  121. data/test/multiverse/suites/no_load/start_up_test.rb +14 -0
  122. data/test/multiverse/suites/rails_3_error_tracing/Envfile +15 -0
  123. data/test/multiverse/suites/rails_3_error_tracing/config/newrelic.yml +165 -0
  124. data/test/multiverse/suites/rails_3_error_tracing/error_tracing_test.rb +236 -0
  125. data/test/multiverse/suites/rails_3_gc/Envfile +8 -0
  126. data/test/multiverse/suites/rails_3_gc/config/newrelic.yml +167 -0
  127. data/test/multiverse/suites/rails_3_gc/instrumentation_test.rb +92 -0
  128. data/test/multiverse/suites/rails_3_queue_time/Envfile +15 -0
  129. data/test/multiverse/suites/rails_3_queue_time/config/newrelic.yml +165 -0
  130. data/test/multiverse/suites/rails_3_queue_time/queue_time_test.rb +75 -0
  131. data/test/multiverse/suites/rails_3_views/.gitignore +3 -0
  132. data/test/multiverse/suites/rails_3_views/Envfile +16 -0
  133. data/test/multiverse/suites/rails_3_views/app/views/foos/_foo.html.haml +1 -0
  134. data/test/multiverse/suites/rails_3_views/app/views/test/_a_partial.html.erb +1 -0
  135. data/test/multiverse/suites/rails_3_views/app/views/test/_mid_partial.html.erb +1 -0
  136. data/test/multiverse/suites/rails_3_views/app/views/test/_top_partial.html.erb +3 -0
  137. data/test/multiverse/suites/rails_3_views/app/views/test/deep_partial.html.erb +3 -0
  138. data/test/multiverse/suites/rails_3_views/app/views/test/haml_view.html.haml +6 -0
  139. data/test/multiverse/suites/rails_3_views/app/views/test/index.html.erb +4 -0
  140. data/test/multiverse/suites/rails_3_views/config/newrelic.yml +164 -0
  141. data/test/multiverse/suites/rails_3_views/view_instrumentation_test.rb +245 -0
  142. data/test/multiverse/suites/resque/Envfile +21 -0
  143. data/test/multiverse/suites/resque/config/newrelic.yml +22 -0
  144. data/test/multiverse/suites/resque/dump.rdb +0 -0
  145. data/test/multiverse/suites/resque/instrumentation_test.rb +73 -0
  146. data/test/multiverse/suites/rum_auto_instrumentation/Envfile +4 -0
  147. data/test/multiverse/suites/rum_auto_instrumentation/config/newrelic.yml +24 -0
  148. data/test/multiverse/suites/rum_auto_instrumentation/problem_response.html +422 -0
  149. data/test/multiverse/suites/rum_auto_instrumentation/responses/worst_case_small.html +5000 -0
  150. data/test/multiverse/suites/rum_auto_instrumentation/sanity_test.rb +115 -0
  151. data/test/multiverse/suites/sinatra/Envfile +13 -0
  152. data/test/multiverse/suites/sinatra/config/newrelic.yml +24 -0
  153. data/test/multiverse/suites/sinatra/sinatra_metric_explosion_test.rb +76 -0
  154. data/test/multiverse/suites/sinatra/sinatra_routes_test.rb +46 -0
  155. data/test/multiverse/test/multiverse_test.rb +55 -0
  156. data/test/multiverse/test/suite_examples/one/a/Envfile +3 -0
  157. data/test/multiverse/test/suite_examples/one/a/a_test.rb +11 -0
  158. data/test/multiverse/test/suite_examples/one/a/config/newrelic.yml +24 -0
  159. data/test/multiverse/test/suite_examples/one/b/Envfile +3 -0
  160. data/test/multiverse/test/suite_examples/one/b/b_test.rb +11 -0
  161. data/test/multiverse/test/suite_examples/one/b/config/newrelic.yml +24 -0
  162. data/test/multiverse/test/suite_examples/three/a/Envfile +2 -0
  163. data/test/multiverse/test/suite_examples/three/a/fail_test.rb +6 -0
  164. data/test/multiverse/test/suite_examples/three/b/Envfile +2 -0
  165. data/test/multiverse/test/suite_examples/three/b/win_test.rb +6 -0
  166. data/test/multiverse/test/suite_examples/two/a/Envfile +1 -0
  167. data/test/multiverse/test/suite_examples/two/a/fail_test.rb +6 -0
  168. data/test/new_relic/agent/agent/connect_test.rb +134 -164
  169. data/test/new_relic/agent/agent/start_test.rb +111 -81
  170. data/test/new_relic/agent/agent/start_worker_thread_test.rb +6 -33
  171. data/test/new_relic/agent/agent_test.rb +88 -9
  172. data/test/new_relic/agent/agent_test_controller.rb +1 -1
  173. data/test/new_relic/agent/agent_test_controller_test.rb +42 -10
  174. data/test/new_relic/agent/beacon_configuration_test.rb +63 -67
  175. data/test/new_relic/agent/browser_monitoring_test.rb +150 -79
  176. data/test/new_relic/agent/configuration/environment_source_test.rb +74 -0
  177. data/test/new_relic/agent/configuration/manager_test.rb +149 -0
  178. data/test/new_relic/agent/configuration/server_source_test.rb +45 -0
  179. data/test/new_relic/agent/configuration/yaml_source_test.rb +56 -0
  180. data/test/new_relic/agent/error_collector/notice_error_test.rb +63 -50
  181. data/test/new_relic/agent/error_collector_test.rb +22 -12
  182. data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +21 -11
  183. data/test/new_relic/agent/instrumentation/metric_frame_test.rb +6 -0
  184. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +2 -2
  185. data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +5 -5
  186. data/test/new_relic/agent/method_tracer_test.rb +6 -6
  187. data/test/new_relic/agent/mock_scope_listener.rb +3 -0
  188. data/test/new_relic/agent/new_relic_service_test.rb +208 -23
  189. data/test/new_relic/agent/pipe_channel_manager_test.rb +34 -17
  190. data/test/new_relic/agent/rpm_agent_test.rb +27 -23
  191. data/test/new_relic/agent/sql_sampler_test.rb +81 -56
  192. data/test/new_relic/agent/stats_engine/metric_stats/harvest_test.rb +3 -20
  193. data/test/new_relic/agent/stats_engine/metric_stats_test.rb +12 -1
  194. data/test/new_relic/agent/stats_engine_test.rb +17 -8
  195. data/test/new_relic/agent/thread_profiler_test.rb +536 -0
  196. data/test/new_relic/agent/thread_test.rb +76 -0
  197. data/test/new_relic/agent/threaded_test.rb +65 -0
  198. data/test/new_relic/agent/transaction_info_test.rb +45 -4
  199. data/test/new_relic/agent/transaction_sample_builder_test.rb +8 -6
  200. data/test/new_relic/agent/transaction_sampler_test.rb +193 -204
  201. data/test/new_relic/agent/worker_loop_test.rb +20 -0
  202. data/test/new_relic/agent_test.rb +69 -41
  203. data/test/new_relic/collection_helper_test.rb +7 -8
  204. data/test/new_relic/command/deployments_test.rb +18 -2
  205. data/test/new_relic/control/frameworks/rails_test.rb +26 -0
  206. data/test/new_relic/control/logging_methods_test.rb +78 -52
  207. data/test/new_relic/control_test.rb +91 -129
  208. data/test/new_relic/fake_collector.rb +103 -31
  209. data/test/new_relic/fake_service.rb +8 -2
  210. data/test/new_relic/load_test.rb +13 -0
  211. data/test/new_relic/local_environment_test.rb +7 -10
  212. data/test/new_relic/metric_data_test.rb +45 -16
  213. data/test/new_relic/noticed_error_test.rb +14 -0
  214. data/test/new_relic/rack/browser_monitoring_test.rb +15 -9
  215. data/test/new_relic/rack/developer_mode_test.rb +13 -7
  216. data/test/new_relic/rack/error_collector_test.rb +74 -0
  217. data/test/new_relic/transaction_sample/segment_test.rb +23 -4
  218. data/test/new_relic/transaction_sample_test.rb +47 -2
  219. data/test/script/build_test_gem.sh +9 -3
  220. data/test/script/ci.sh +48 -21
  221. data/test/script/ci_multiverse_runner.sh +11 -11
  222. data/test/test_helper.rb +37 -18
  223. data/ui/helpers/developer_mode_helper.rb +21 -11
  224. data/ui/views/layouts/newrelic_default.rhtml +1 -0
  225. data/ui/views/newrelic/show_sample.rhtml +1 -1
  226. data/ui/views/newrelic/threads.rhtml +2 -10
  227. data/vendor/gems/metric_parser-0.1.0.pre1/.specification +116 -0
  228. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_init.rb +7 -0
  229. metadata +132 -58
  230. data/lib/new_relic/control/configuration.rb +0 -206
  231. data/test/new_relic/control/configuration_test.rb +0 -77
@@ -0,0 +1,21 @@
1
+ Gemfile.lock
2
+ newrelic_rpm.gemspec
3
+ .DS\_Store
4
+ .svn/
5
+ *~
6
+ *.rbc
7
+ pkg/
8
+ *.gem
9
+ !rails
10
+ Manifest*
11
+ .idea/
12
+ tmp/
13
+ TAGS
14
+ tags
15
+ *.swp
16
+ *.swo
17
+
18
+ /log/
19
+ /lerg/
20
+ gems/newrelic_rpm.gemspec
21
+ gems/newrelic_rpm*.tar.gz
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name>New Relic Agent</name>
4
+ <comment></comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ <buildCommand>
9
+ <name>com.aptana.ide.core.unifiedBuilder</name>
10
+ <arguments>
11
+ </arguments>
12
+ </buildCommand>
13
+ <buildCommand>
14
+ <name>org.rubypeople.rdt.core.rubybuilder</name>
15
+ <arguments>
16
+ </arguments>
17
+ </buildCommand>
18
+ </buildSpec>
19
+ <natures>
20
+ <nature>com.aptana.ruby.core.rubynature</nature>
21
+ <nature>org.rubypeople.rdt.core.rubynature</nature>
22
+ </natures>
23
+ </projectDescription>
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - ree
5
+ - 1.9.2
6
+ - 1.9.3
7
+ - jruby-19mode
8
+ - jruby-18mode
9
+
data/CHANGELOG CHANGED
@@ -1,6 +1,185 @@
1
+
2
+ # New Relic Ruby Agent Release Notes #
3
+
4
+ ## v3.5.3 ##
5
+
6
+ * Update the collector protocol to use JSON and Ruby primitives
7
+
8
+ The communication between the agent and the NewRelic will not longer be
9
+ marshalled Ruby objects, but rather JSON in the case of Ruby 1.9 and marshalled
10
+ Ruby primitives in the case of 1.8. This results in greater harvest efficiency
11
+ as well as feature parity with other New Relic agents.
12
+
13
+ * Fix incorrect application of conditions in sinatra instrumentation
14
+
15
+ The agent's sinatra instrumentation was causing sinatra's condidtions to
16
+ be incorrectly applied in some obscure cases. The bug was triggered
17
+ when a condition was present on a lower priority route that would match
18
+ the current request, except for the precense of a higher priority route.
19
+
20
+ ## v3.5.2 ##
21
+
22
+ * Simplified process of running agent test suite and documented code
23
+ contribution process in GUIDELINES_FOR_CONTRIBUTING.
24
+
25
+ ## v3.5.1 ##
26
+
27
+ * Enabling Memory Profiling on Lion and Mountain Lion
28
+
29
+ The agent's list of supported platforms for memory profiling wasn't correctly checking
30
+ for more recent versions of OS X.
31
+
32
+ * Fixed an arity issue encountered when calling newrelic_notice_error from Rails applications.
33
+
34
+ * End user queue time was not being properly reported, works properly now.
35
+
36
+ * Server-side configuration for ignoring errors was not being heeded by agent.
37
+
38
+ * Better handling of a thread safety issue.
39
+
40
+ Some issues may remain, which we are working to address, but they should be gracefully handled
41
+ now, rather than crashing the running app.
42
+
43
+ * Use "java_import" rather than "include_class" when require Java Jars into a JRuby app.
44
+
45
+ Thanks to Jan Habermann for the pull request
46
+
47
+ * Replaced alias_method mechanism with super call in DataMapper instrumentation.
48
+
49
+ Thanks to Michael Rykov for the pull request
50
+
51
+ * Fixed the Rubinius GC profiler.
52
+
53
+ Thanks to Dirkjan Bussink
54
+
55
+ * Use ActiveSupport.on_load to load controller instrumentation Rails 3.
56
+
57
+ Thanks to Jonathan del Strother
58
+
59
+ * Reduce the number of thread local reference in a particular high traffic method
60
+
61
+ Thanks to Jeremy Kemper
62
+
63
+ ## v3.5.0.1 ##
64
+
65
+ * (Fix) Due to a serious resource leak we have ended support for versions of Phusion Passenger
66
+ older than 2.1.1. Users of older versions are encouraged upgrade to a more recent version.
67
+
68
+ ## v3.5.0 ##
69
+
70
+ * (Fix) RUM Stops Working After 3.4.2.1 Agent Upgrade
71
+
72
+ v3.4.2.1 introduced a bug that caused the browser monitor auto instrumentation
73
+ (for RUM) default to be false. The correct value of true is now used
74
+
75
+ * When the Ruby Agent detects Unicorn as the dispatcher it creates an INFO level log message
76
+ with additional information
77
+
78
+ To help customers using Unicorn, if the agent detects it (Unicorn) is being used as the
79
+ dispatcher an INFO level log message it created that includes a link to New Relic
80
+ online doc that has additional steps that may be required to get performance data reporting.
81
+
82
+ * (Fix) In version 3.4.2 of the Ruby Agent the server side value for Apdex T was disgregarded
83
+
84
+ With version 3.4.2 of the agent, the value set in the newrelic.yml file took precedence over the
85
+ value set in the New Relic UI. As of version 3.5.0 only the value for Apdex T set in the
86
+ New Relic UI will be used. Any setting in the yaml file will be ignored.
87
+
88
+ * Improved Error Detection/Reporting capabilities for Rails 3 apps
89
+
90
+ Some errors are missed by the agent's exception reporting handlers because they are
91
+ generated in the rails stack, outside of the instrumented controller action. A Rack
92
+ middleware is now included that can detect these errors as they bubble out of the middleware stack.
93
+ Note that this does not include Routing Errors.
94
+
95
+ * The Ruby Agent now logs certain information it receives from the New Relic servers
96
+
97
+ After connecting to the New Relic servers the agent logs the New Relic URL
98
+ of the app it is reporting to.
99
+
100
+ * GC profiling overhead for Ruby 1.9 reduced
101
+
102
+ For Ruby 1.9 the amount of time spent in GC profiling has been reduced.
103
+
104
+ * Know issue with Ruby 1.8.7-p334, sqlite3-ruby 1.3.0 or older, and resque 1.23.0
105
+
106
+ The Ruby Agent will not work in conjunction with Ruby 1.8.7-p334, sqlite3-ruby 1.3.3
107
+ or earlier, and resque 1.23.0. Your app will likely stop functioning. This is a known problem
108
+ with Ruby versions up to 1.8.7-p334. Upgrading to the last release of Ruby 1.8.7
109
+ is recommended. This issue has been present in every version of the agent we've tested
110
+ going back for a year.
111
+
112
+
113
+ ### previous versions ###
114
+ ## v3.4.2.1 ##
115
+
116
+ * Fix issue when app_name is nil
117
+
118
+ If the app_name setting ends up being nil an exception got generated and the application
119
+ wouldn't run. This would notably occur when running a Heroku app locally without the
120
+ NEW_RELIC_APP_NAME environment variable set. A nil app_name is now detected and an
121
+ error logged specifying remediation.
122
+
123
+ ## v3.4.2 ##
124
+
125
+ * The RUM NRAGENT tk value gets more robustly sanitized to prevent potential XSS vulnerabilities
126
+
127
+ The code that scrubes the token used in Real User Monitoring has been enhanced to be
128
+ more robust.
129
+
130
+ * Support for Apdex T in server side configuration
131
+
132
+ For those using server side configuration the Ruby Agent now supports setting
133
+ the Apdex T value via the New Relic UI.
134
+
135
+ * Refactoring of agent config code
136
+
137
+ The code that reads the configuration information and confirgures the agent
138
+ got substantially reorganized, consolidated, simplified, and made more robust.
139
+
140
+ ## v3.4.1 ##
141
+ #### Bug Fixes ####
142
+ * Fix edge case in RUM auto instrumentation where X-UA-Compatible meta tag is
143
+ present but </head> tag is missing.
144
+
145
+ There is a somewhat obscure edge case where RUM auto instrumentation will
146
+ crash a request. The issue seems to be triggered when the X-UA-Compatible
147
+ meta tag is present and the </head> tag is missing.
148
+
149
+ * Fixed reference to @service.request_timeout to @request_timeout in
150
+ new_relic_service.rb. (Thanks to Matthew Savage)
151
+
152
+ When a timeout occurred during connection to the collector an "undefined
153
+ method `request_timeout' for nil:NilClass'" would get raised.
154
+
155
+ * preserve visibility on traced methods.
156
+
157
+ Aliased methods now have the same visibility as the original traced method.
158
+ A couple of the esoteric methods created in the process weren't getting the
159
+ visibility set properly.
160
+
161
+ * Agent service does not connect to directed shard collector after connecting
162
+ to proxy
163
+
164
+ After connecting to collector proxy name of real collector was updated, but
165
+ ip address was not being updated causing connections to go to the proxy.
166
+ Agent now looks up ip address for real collector.
167
+
168
+ * corrupt marshal data from pipe children crashing agent
169
+
170
+ If the agent receieved corrupted data from the Reqsue worker child agent
171
+ it could crash the agent itself. fixed.
172
+
173
+ * should reset RubyBench GC counter between polls
174
+
175
+ On Ruby REE, the GC profiler does not reset the counter between polls. This
176
+ is only a problem if GC could happen *between* transactions, as in, for
177
+ example, out-of-band GC in Unicorn. fixed.
178
+
1
179
  v3.4.0.1
2
180
  * Prevent the agent from resolving the collector address when disabled.
3
181
  * Fix for error collector configuration that was introduced during beta.
182
+ * Preserve method visibility when methods are traced with #add_method_tracer and #add_transaction_tracer
4
183
 
5
184
  v3.4.0
6
185
  * Major refactor of data transmission mechanism. This enabled child processes to send data to parent processes, which then send the data to the New Relic service. This should only affect Resque users, dramatically improving their experience.
@@ -282,7 +461,7 @@ v2.10.1.
282
461
  * add 'multi_threaded' config option to indicate when the app is running
283
462
  multi-threaded, so we can disable some instrumentation
284
463
  * fix test failures in JRuby, REE
285
- * improve Net::HTTP instrumentation so its more efficient and distinguishes calls
464
+ * improve Net::HTTP instrumentation so it's more efficient and distinguishes calls
286
465
  between web and non-web transactions.
287
466
  * database instrumentation notices all database commands in addition to the core commands
288
467
  * add support for textmate to dev mode
@@ -0,0 +1,73 @@
1
+ # Guidelines for Contributing Code
2
+
3
+ At New Relic we welcome community code contributions to the Ruby Agent, and have
4
+ taken effort to make this process easy for both contributors and our development
5
+ team.
6
+
7
+ When contributing keep in mind that the agent runs in a wide variety of ruby
8
+ language implementations (e.g. 1.8.6, 1.8.7, 1.9.x, jruby, etc.) as well as a
9
+ wide variety of application environments (e.g. rails, sinatra, roll-your-own,
10
+ etc., etc.)
11
+
12
+ Because of this we need to be more defensive in our coding practices than most
13
+ projects. Syntax must be compatible with all supported ruby implementations
14
+ (e.g. no 1.9 specific hash syntax) and we can't assume the presence of any
15
+ specific libraries such as `ActiveSupport`.
16
+
17
+ ## Testing
18
+
19
+ The agent includes a suite of unit and functional tests which should be used to
20
+ verify your changes don't break existing functionality.
21
+
22
+ Unit tests are stored in the `test/new_relic` directory.
23
+
24
+ Functional tests are stored in the `test/multiverse` directory.
25
+
26
+ ### Running Tests
27
+
28
+ Running the test suite is simple. Just invoke:
29
+
30
+ bundle
31
+ bundle exec rake
32
+
33
+ This will run the unit tests in standalone mode, bootstrapping a basic Rails
34
+ 3.2 environment for the agent to instrument then executing the test suite.
35
+
36
+ These tests are setup to run automatically in
37
+ [travis-ci](https://travis-ci.org/newrelic/rpm) under several Ruby implementations.
38
+ When you've pushed your changes to github you can confirm that the travis-ci
39
+ build passes for your fork of the codebase.
40
+
41
+ Additionally, our own CI jobs runs these tests under multiple versions of Rails to
42
+ verify compatibility.
43
+
44
+ ### Writing Tests
45
+
46
+ For most contributions it is strongly recommended to add additional tests which
47
+ exercise your changes.
48
+
49
+ This helps us efficiently incorporate your changes into our mainline codebase
50
+ and provides a safeguard that your change won't be broken by future development.
51
+
52
+ There are some rare cases where code changes do not result in changed
53
+ functionality (e.g. a performance optimization) and new tests are not required.
54
+ In general, including tests with your pull request dramatically increases the
55
+ chances it will be accepted.
56
+
57
+ ### Functional Testing
58
+
59
+ For cases where the unit test environment is not sufficient for testing a
60
+ change (e.g. instrumentation for a non-rails framework, not available in the
61
+ unit test environment), we have a functional testing suite called multiverse.
62
+ These tests can be run by invoking:
63
+
64
+ bundle
65
+ bundle exec rake test:multiverse
66
+
67
+ ### And Finally...
68
+
69
+ You are welcome to send pull requests to us - however, by doing so you agree
70
+ that you are granting New Relic a non-exclusive, non-revokable, no-cost license
71
+ to use the code, algorithms, patents, and ideas in that code in our products if
72
+ we so choose. You also agree the code is provided as-is and you provide no
73
+ warranties as to its fitness or correctness for any purpose.
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source :rubygems
2
+
3
+ group :development do
4
+ # require 0.9.2.2.
5
+ # There's problems with the test task in rake 10
6
+ # https://github.com/jimweirich/rake/issues/144
7
+ gem 'rake', '0.9.2.2'
8
+ gem 'mocha', '~>0.12.0'
9
+ gem 'shoulda', '~>3.0.1'
10
+ gem 'sdoc-helpers'
11
+ gem 'rdoc', '>= 2.4.2'
12
+ gem 'rails', '~>3.2.0'
13
+ gem 'sqlite3', :platform => 'mri'
14
+ gem 'activerecord-jdbcsqlite3-adapter', :platform => 'jruby'
15
+ gem 'jruby-openssl', :platform => 'jruby'
16
+ end
@@ -0,0 +1,15 @@
1
+
2
+ PLEASE NOTE:
3
+
4
+ Developer Mode is now a Rack middleware.
5
+
6
+ Developer Mode is no longer available in Rails 2.1 and earlier.
7
+ However, starting in version 2.12 you can use Developer Mode in any
8
+ Rack based framework, in addition to Rails. To install developer mode
9
+ in a non-Rails application, just add NewRelic::Rack::DeveloperMode to
10
+ your middleware stack.
11
+
12
+ If you are using JRuby, we recommend using at least version 1.4 or
13
+ later because of issues with the implementation of the timeout library.
14
+
15
+ Refer to the README.md file for more information.
data/LICENSE CHANGED
@@ -25,7 +25,7 @@ See https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
25
25
 
26
26
 
27
27
  All other components of this product are
28
- Copyright (c) 2008-2011 New Relic, Inc. All rights reserved.
28
+ Copyright (c) 2008-2012 New Relic, Inc. All rights reserved.
29
29
 
30
30
  Certain inventions disclosed in this file may be claimed within
31
31
  patents owned or patent applications filed by New Relic, Inc. or third
@@ -1,30 +1,30 @@
1
- = New Relic Ruby Agent
1
+ # New Relic Ruby Agent
2
2
 
3
3
  New Relic is a performance management system, developed by
4
4
  New Relic, Inc (http://www.newrelic.com). It provides you with deep
5
5
  information about the performance of your Rails or Ruby
6
6
  application as it runs in production. The New Relic Ruby Agent is
7
7
  dual-purposed as a either a Rails plugin or a Gem, hosted on
8
- github[http://github.com/newrelic/rpm/tree/master].
8
+ [github](http://github.com/newrelic/rpm/tree/master).
9
9
 
10
10
  The New Relic Ruby Agent runs in one of two modes:
11
11
 
12
- ==== Production Mode
12
+ #### Production Mode
13
13
 
14
14
  Low overhead instrumentation that captures detailed information on
15
15
  your application running in production and transmits them to
16
16
  newrelic.com where you can monitor them in real time.
17
17
 
18
- ==== Developer Mode
18
+ #### Developer Mode
19
19
 
20
- A Rack middleware that maps /newrelic to an application for showing
20
+ A Rack middleware that maps `/newrelic` to an application for showing
21
21
  detailed performance metrics on a page by page basis. Installed
22
22
  automatically in Rails applications.
23
23
 
24
- == Supported Environments
24
+ ## Supported Environments
25
25
 
26
- * Ruby 1.8.7, 1.9.1, or 1.9.2, including REE
27
- * JRuby 1.4 or higher
26
+ * Ruby 1.8.6, 1.8.7, REE, 1.9.x
27
+ * JRuby 1.6 and 1.7
28
28
  * Rails 2.0 or later for Production Mode
29
29
  * Rails 2.3 or later for Developer Mode
30
30
  * Sinatra
@@ -37,27 +37,42 @@ desired. Report any problems to support@newrelic.com.
37
37
  You can also monitor non-web applications. Refer to the "Other
38
38
  Environments" section under "Getting Started".
39
39
 
40
- = Getting Started
40
+ ## Contributing Code
41
41
 
42
- Install the Ruby Agent as a gem. If you are using Rails you can
43
- install the gem as a plug-in--details below.
42
+ We welcome code contributions (in the form of pull requests) from our user
43
+ community. Before submitting a pull request please review
44
+ [GUIDELINES_FOR_CONTRIBUTING](https://github.com/newrelic/rpm/blob/master/GUIDELINES_FOR_CONTRIBUTING.md).
44
45
 
45
- gem install newrelic_rpm
46
+ Following these helps us efficiently review and incorporate your contribution
47
+ and avoid breaking your code with future changes to the agent.
48
+
49
+
50
+ ## Getting Started
51
+
52
+ Install the Ruby Agent as a gem.
53
+
54
+ gem install newrelic_rpm
55
+
56
+ Or add it to your project's Gemfile.
57
+
58
+ gem 'newrelic_rpm'
46
59
 
47
60
  To monitor your applications in production, create an account at
48
61
  http://newrelic.com/ . There you can
49
62
  sign up for a free Lite account or one of our paid subscriptions.
50
63
 
51
64
  Once you receive the welcome e-mail with a license key and
52
- +newrelic.yml+ file, copy the +newrelic.yml+ file into your app config
65
+ `newrelic.yml` file, copy the `newrelic.yml` file into your app config
53
66
  directory.
54
67
 
55
- All agent configuration is done in the +newrelic.yml+ file. This file
56
- is by default read from the +config+ directory of the application root
68
+ The initial configuration is done in the `newrelic.yml` file. This file
69
+ is by default read from the `config` directory of the application root
57
70
  and is subsequently searched for in the application root directory,
58
- and then in a <tt>~/.newrelic</tt> directory
71
+ and then in a `~/.newrelic` directory. Once you're up and running you can
72
+ enable Server Side Config and manage your newrelic configuation from the web
73
+ UI.
59
74
 
60
- === Rails Installation
75
+ #### Rails Installation
61
76
 
62
77
  You can install the agent as a Gem:
63
78
 
@@ -68,88 +83,87 @@ Add the following line to your Gemfile:
68
83
  gem 'newrelic_rpm'
69
84
 
70
85
  For Rails 2.x without Bundler:
71
-
72
- edit +environment.rb+ and add to the initalizer block:
73
-
74
- config.gem "newrelic_rpm"
75
-
76
- === Merb Installation
77
86
 
78
- To monitor a merb app install the newrelic_rpm gem and add
87
+ edit `environment.rb` and add to the initalizer block:
79
88
 
80
- dependency 'newrelic_rpm'
89
+ config.gem "newrelic_rpm"
81
90
 
82
- to your init.rb file.
83
-
84
- === Sinatra Installation
91
+ #### Sinatra Installation
85
92
 
86
93
  To use the Ruby Agent with a Sinatra app, add
94
+
87
95
  require 'newrelic_rpm'
96
+
88
97
  in your Sinatra app, below the Sinatra require directive.
89
98
 
90
- Then make sure you set RACK_ENV to the environment corresponding to the
91
- configuration definitions in the newrelic.yml file; i.e., development,
99
+ Then make sure you set `RACK_ENV` to the environment corresponding to the
100
+ configuration definitions in the newrelic.yml file; e.g., development,
92
101
  staging, production, etc.
93
102
 
94
- To use Developer Mode in Sinatra, add NewRelic::Rack::DeveloperMode to
95
- the middleware stack. See the +config.ru+ sample below.
103
+ To use Developer Mode in Sinatra, add `NewRelic::Rack::DeveloperMode` to
104
+ the middleware stack. See the `config.ru` sample below.
105
+
106
+ #### Other Environments
96
107
 
97
- === Other Environments
108
+ You can use the Ruby Agent to monitor any Ruby application. Add
98
109
 
99
- You can use the Ruby Agent to monitor any Ruby application. Add
100
110
  require 'newrelic_rpm'
111
+
101
112
  to your startup sequence and then manually start the agent using
113
+
102
114
  NewRelic::Agent.manual_start
103
115
 
104
116
  To instrument Rack based applications, refer to the docs in
105
- NewRelic::Agent::Instrumentation::Rack.
117
+ `NewRelic::Agent::Instrumentation::Rack`.
106
118
 
107
- Refer to the docs in New Relic for details on how to monitor other web
108
- frameworks, background jobs, and daemons.
119
+ Refer to the [New Relic's Docs](http://newrelic.com/docs) for details on how to
120
+ monitor other web frameworks, background jobs, and daemons.
109
121
 
110
- Also, see if your environment is already supported by the
111
- rpm_contrib[http://newrelic.github.com/rpm_contrib] gem.
122
+ The Ruby Agent provides an API that allows custom instrumentation of additional
123
+ frameworks. You can find a list of community created intrumentation plugins
124
+ (e.g. [newrelic-redis](https://github.com/evanphx/newrelic-redis)) in the
125
+ [RPM Contrib README](https://github.com/newrelic/rpm_contrib/blob/master/README.md#new-relic-ruby-agent-plugins-seperate-projects).
112
126
 
113
- == Developer Mode
127
+ ## Developer Mode
114
128
 
115
129
  When running the Developer Mode, the Ruby Agent will track the
116
130
  performance of every HTTP request serviced by your application, and
117
131
  store in memory this information for the last 100 HTTP transactions.
118
132
 
119
133
  To view this performance information, including detailed SQL statement
120
- analysis, open +/newrelic+ in your web application. For instance if
134
+ analysis, open `/newrelic` in your web application. For instance if
121
135
  you are running mongrel or thin on port 3000, enter the following into
122
136
  your browser:
123
137
 
124
138
  http://localhost:3000/newrelic
125
139
 
126
- Developer Mode is only initialized if the +developer_mode+ setting in
140
+ Developer Mode is only initialized if the `developer_mode` setting in
127
141
  the newrelic.yml file is set to true. By default, it is turned off in
128
- all environments but +development+.
142
+ all environments but `development`.
129
143
 
130
- ==== Developer Mode in Rails
144
+ #### Developer Mode in Rails
131
145
 
132
146
  Developer Mode is available automatically in Rails Applications based
133
147
  on Rails 2.3 and later. No additional configuration is required. When
134
- your application starts and +developer_mode+ is enabled, the Ruby
148
+ your application starts and `developer_mode` is enabled, the Ruby
135
149
  Agent injects a middleware into your Rails middleware stack.
136
150
 
137
151
  For earlier versions of Rails that support Rack, you can use
138
- a +config.ru+ as below.
152
+ a `config.ru` as below.
139
153
 
140
- ==== Developer Mode in Rack Applications
154
+ #### Developer Mode in Rack Applications
141
155
 
142
156
  Developer Mode is available for any Rack based application such as
143
157
  Sinatra by installing the NewRelic::Rack::DeveloperMode
144
158
  middleware. This middleware passes all requests that do not start with
145
159
  /newrelic.
146
160
 
147
- Here's an example entry for Developer Mode in a +config.ru+ file:
161
+ Here's an example entry for Developer Mode in a `config.ru` file:
148
162
 
149
163
  require 'new_relic/rack/developer_mode'
150
164
  use NewRelic::Rack::DeveloperMode
151
165
 
152
- == Production Mode
166
+ ## Production Mode
153
167
 
154
168
  When your application runs in the production environment, the New
155
169
  Relic agent runs in production mode. It connects to the New Relic
@@ -157,13 +171,13 @@ service and sends deep performance data to the UI for your
157
171
  analysis. To view this data, log in to http://rpm.newrelic.com.
158
172
 
159
173
  NOTE: You must have a valid account and license key to view this data
160
- online. Refer to instructions in *Getting Started*, below.
174
+ online. Refer to instructions in *Getting Started*.
161
175
 
162
176
 
163
- = Support
177
+ ## Support
164
178
 
165
179
  Reach out to us--and to fellow users--at
166
- support.newrelic.com[http://support.newrelic.com/].
180
+ [support.newrelic.com](http://support.newrelic.com/).
167
181
  There you'll find documentation, FAQs, and forums where you can submit
168
182
  suggestions and discuss New Relic with staff and other users.
169
183
 
@@ -171,9 +185,11 @@ Also available is community support on IRC: we generally use #newrelic
171
185
  on irc.freenode.net
172
186
 
173
187
  Find a bug? E-mail support@newrelic.com, or post it to
174
- support.newrelic.com[http://support.newrelic.com/].
175
188
 
176
- Thank you, and may your application scale to infinity plus one.
189
+ [support.newrelic.com](http://support.newrelic.com/).
190
+
191
+ Thank you, and may your application scale to infinity plus one.
192
+
193
+ Lew Cirne, Founder and CEO
177
194
 
178
- Lew Cirne, Founder and CEO<br/>
179
195
  New Relic, Inc.