dolores_rpm 3.2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. data/CHANGELOG +559 -0
  2. data/LICENSE +64 -0
  3. data/README.rdoc +179 -0
  4. data/bin/mongrel_rpm +33 -0
  5. data/bin/newrelic +13 -0
  6. data/bin/newrelic_cmd +5 -0
  7. data/cert/cacert.pem +118 -0
  8. data/cert/oldsite.pem +28 -0
  9. data/cert/site.pem +27 -0
  10. data/dolores_rpm-3.3.4.fork.gem +0 -0
  11. data/install.rb +9 -0
  12. data/lib/conditional_vendored_dependency_detection.rb +3 -0
  13. data/lib/conditional_vendored_metric_parser.rb +5 -0
  14. data/lib/new_relic/agent/agent.rb +1311 -0
  15. data/lib/new_relic/agent/beacon_configuration.rb +110 -0
  16. data/lib/new_relic/agent/browser_monitoring.rb +102 -0
  17. data/lib/new_relic/agent/busy_calculator.rb +99 -0
  18. data/lib/new_relic/agent/chained_call.rb +13 -0
  19. data/lib/new_relic/agent/database.rb +203 -0
  20. data/lib/new_relic/agent/error_collector.rb +251 -0
  21. data/lib/new_relic/agent/instrumentation/active_merchant.rb +27 -0
  22. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +68 -0
  23. data/lib/new_relic/agent/instrumentation/authlogic.rb +19 -0
  24. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +424 -0
  25. data/lib/new_relic/agent/instrumentation/data_mapper.rb +57 -0
  26. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +52 -0
  27. data/lib/new_relic/agent/instrumentation/memcache.rb +80 -0
  28. data/lib/new_relic/agent/instrumentation/merb/controller.rb +41 -0
  29. data/lib/new_relic/agent/instrumentation/merb/errors.rb +29 -0
  30. data/lib/new_relic/agent/instrumentation/metric_frame/pop.rb +80 -0
  31. data/lib/new_relic/agent/instrumentation/metric_frame.rb +332 -0
  32. data/lib/new_relic/agent/instrumentation/net.rb +29 -0
  33. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +36 -0
  34. data/lib/new_relic/agent/instrumentation/queue_time.rb +210 -0
  35. data/lib/new_relic/agent/instrumentation/rack.rb +98 -0
  36. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +114 -0
  37. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +42 -0
  38. data/lib/new_relic/agent/instrumentation/rails/active_record_instrumentation.rb +115 -0
  39. data/lib/new_relic/agent/instrumentation/rails/errors.rb +42 -0
  40. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +118 -0
  41. data/lib/new_relic/agent/instrumentation/rails3/active_record_instrumentation.rb +122 -0
  42. data/lib/new_relic/agent/instrumentation/rails3/errors.rb +37 -0
  43. data/lib/new_relic/agent/instrumentation/sinatra.rb +58 -0
  44. data/lib/new_relic/agent/instrumentation/sunspot.rb +29 -0
  45. data/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb +21 -0
  46. data/lib/new_relic/agent/instrumentation.rb +9 -0
  47. data/lib/new_relic/agent/method_tracer.rb +528 -0
  48. data/lib/new_relic/agent/sampler.rb +50 -0
  49. data/lib/new_relic/agent/samplers/cpu_sampler.rb +58 -0
  50. data/lib/new_relic/agent/samplers/delayed_job_lock_sampler.rb +40 -0
  51. data/lib/new_relic/agent/samplers/memory_sampler.rb +144 -0
  52. data/lib/new_relic/agent/samplers/object_sampler.rb +26 -0
  53. data/lib/new_relic/agent/shim_agent.rb +29 -0
  54. data/lib/new_relic/agent/sql_sampler.rb +267 -0
  55. data/lib/new_relic/agent/stats_engine/metric_stats.rb +187 -0
  56. data/lib/new_relic/agent/stats_engine/samplers.rb +95 -0
  57. data/lib/new_relic/agent/stats_engine/transactions.rb +208 -0
  58. data/lib/new_relic/agent/stats_engine.rb +25 -0
  59. data/lib/new_relic/agent/transaction_sample_builder.rb +101 -0
  60. data/lib/new_relic/agent/transaction_sampler.rb +397 -0
  61. data/lib/new_relic/agent/worker_loop.rb +89 -0
  62. data/lib/new_relic/agent.rb +454 -0
  63. data/lib/new_relic/collection_helper.rb +75 -0
  64. data/lib/new_relic/command.rb +85 -0
  65. data/lib/new_relic/commands/deployments.rb +105 -0
  66. data/lib/new_relic/commands/install.rb +80 -0
  67. data/lib/new_relic/control/class_methods.rb +53 -0
  68. data/lib/new_relic/control/configuration.rb +202 -0
  69. data/lib/new_relic/control/frameworks/external.rb +16 -0
  70. data/lib/new_relic/control/frameworks/merb.rb +31 -0
  71. data/lib/new_relic/control/frameworks/rails.rb +164 -0
  72. data/lib/new_relic/control/frameworks/rails3.rb +75 -0
  73. data/lib/new_relic/control/frameworks/ruby.rb +42 -0
  74. data/lib/new_relic/control/frameworks/sinatra.rb +20 -0
  75. data/lib/new_relic/control/frameworks.rb +10 -0
  76. data/lib/new_relic/control/instance_methods.rb +179 -0
  77. data/lib/new_relic/control/instrumentation.rb +100 -0
  78. data/lib/new_relic/control/logging_methods.rb +143 -0
  79. data/lib/new_relic/control/profiling.rb +25 -0
  80. data/lib/new_relic/control/server_methods.rb +114 -0
  81. data/lib/new_relic/control.rb +46 -0
  82. data/lib/new_relic/data_serialization.rb +157 -0
  83. data/lib/new_relic/delayed_job_injection.rb +46 -0
  84. data/lib/new_relic/language_support.rb +69 -0
  85. data/lib/new_relic/local_environment.rb +414 -0
  86. data/lib/new_relic/merbtasks.rb +6 -0
  87. data/lib/new_relic/metric_data.rb +51 -0
  88. data/lib/new_relic/metric_spec.rb +75 -0
  89. data/lib/new_relic/metrics.rb +9 -0
  90. data/lib/new_relic/noticed_error.rb +24 -0
  91. data/lib/new_relic/rack/browser_monitoring.rb +68 -0
  92. data/lib/new_relic/rack/developer_mode.rb +268 -0
  93. data/lib/new_relic/recipes.rb +73 -0
  94. data/lib/new_relic/stats.rb +388 -0
  95. data/lib/new_relic/timer_lib.rb +27 -0
  96. data/lib/new_relic/transaction_analysis/segment_summary.rb +49 -0
  97. data/lib/new_relic/transaction_analysis.rb +77 -0
  98. data/lib/new_relic/transaction_sample/composite_segment.rb +27 -0
  99. data/lib/new_relic/transaction_sample/fake_segment.rb +9 -0
  100. data/lib/new_relic/transaction_sample/segment.rb +201 -0
  101. data/lib/new_relic/transaction_sample/summary_segment.rb +21 -0
  102. data/lib/new_relic/transaction_sample.rb +245 -0
  103. data/lib/new_relic/url_rule.rb +14 -0
  104. data/lib/new_relic/version.rb +55 -0
  105. data/lib/newrelic_rpm.rb +49 -0
  106. data/lib/tasks/all.rb +4 -0
  107. data/lib/tasks/install.rake +7 -0
  108. data/lib/tasks/tests.rake +19 -0
  109. data/newrelic.yml +265 -0
  110. data/recipes/newrelic.rb +6 -0
  111. data/test/active_record_fixtures.rb +77 -0
  112. data/test/config/newrelic.yml +48 -0
  113. data/test/config/test_control.rb +48 -0
  114. data/test/new_relic/agent/agent/connect_test.rb +410 -0
  115. data/test/new_relic/agent/agent/start_test.rb +255 -0
  116. data/test/new_relic/agent/agent/start_worker_thread_test.rb +153 -0
  117. data/test/new_relic/agent/agent_test.rb +139 -0
  118. data/test/new_relic/agent/agent_test_controller.rb +77 -0
  119. data/test/new_relic/agent/agent_test_controller_test.rb +363 -0
  120. data/test/new_relic/agent/apdex_from_server_test.rb +9 -0
  121. data/test/new_relic/agent/beacon_configuration_test.rb +108 -0
  122. data/test/new_relic/agent/browser_monitoring_test.rb +278 -0
  123. data/test/new_relic/agent/busy_calculator_test.rb +81 -0
  124. data/test/new_relic/agent/database_test.rb +162 -0
  125. data/test/new_relic/agent/error_collector/notice_error_test.rb +257 -0
  126. data/test/new_relic/agent/error_collector_test.rb +175 -0
  127. data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +538 -0
  128. data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +36 -0
  129. data/test/new_relic/agent/instrumentation/instrumentation_test.rb +11 -0
  130. data/test/new_relic/agent/instrumentation/metric_frame/pop_test.rb +172 -0
  131. data/test/new_relic/agent/instrumentation/metric_frame_test.rb +50 -0
  132. data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +84 -0
  133. data/test/new_relic/agent/instrumentation/queue_time_test.rb +387 -0
  134. data/test/new_relic/agent/instrumentation/rack_test.rb +35 -0
  135. data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +184 -0
  136. data/test/new_relic/agent/memcache_instrumentation_test.rb +143 -0
  137. data/test/new_relic/agent/method_tracer/class_methods/add_method_tracer_test.rb +164 -0
  138. data/test/new_relic/agent/method_tracer/instance_methods/trace_execution_scoped_test.rb +234 -0
  139. data/test/new_relic/agent/method_tracer_test.rb +386 -0
  140. data/test/new_relic/agent/mock_scope_listener.rb +23 -0
  141. data/test/new_relic/agent/rpm_agent_test.rb +149 -0
  142. data/test/new_relic/agent/sampler_test.rb +19 -0
  143. data/test/new_relic/agent/shim_agent_test.rb +20 -0
  144. data/test/new_relic/agent/sql_sampler_test.rb +160 -0
  145. data/test/new_relic/agent/stats_engine/metric_stats/harvest_test.rb +150 -0
  146. data/test/new_relic/agent/stats_engine/metric_stats_test.rb +82 -0
  147. data/test/new_relic/agent/stats_engine/samplers_test.rb +99 -0
  148. data/test/new_relic/agent/stats_engine_test.rb +185 -0
  149. data/test/new_relic/agent/transaction_sample_builder_test.rb +195 -0
  150. data/test/new_relic/agent/transaction_sampler_test.rb +955 -0
  151. data/test/new_relic/agent/worker_loop_test.rb +66 -0
  152. data/test/new_relic/agent_test.rb +175 -0
  153. data/test/new_relic/collection_helper_test.rb +149 -0
  154. data/test/new_relic/command/deployments_test.rb +68 -0
  155. data/test/new_relic/control/class_methods_test.rb +62 -0
  156. data/test/new_relic/control/configuration_test.rb +72 -0
  157. data/test/new_relic/control/logging_methods_test.rb +185 -0
  158. data/test/new_relic/control_test.rb +254 -0
  159. data/test/new_relic/data_serialization_test.rb +208 -0
  160. data/test/new_relic/delayed_job_injection_test.rb +16 -0
  161. data/test/new_relic/local_environment_test.rb +72 -0
  162. data/test/new_relic/metric_data_test.rb +125 -0
  163. data/test/new_relic/metric_spec_test.rb +95 -0
  164. data/test/new_relic/rack/all_test.rb +11 -0
  165. data/test/new_relic/rack/browser_monitoring_test.rb +84 -0
  166. data/test/new_relic/rack/developer_mode_helper_test.rb +141 -0
  167. data/test/new_relic/rack/developer_mode_test.rb +43 -0
  168. data/test/new_relic/stats_test.rb +426 -0
  169. data/test/new_relic/transaction_analysis/segment_summary_test.rb +91 -0
  170. data/test/new_relic/transaction_analysis_test.rb +121 -0
  171. data/test/new_relic/transaction_sample/composite_segment_test.rb +35 -0
  172. data/test/new_relic/transaction_sample/fake_segment_test.rb +17 -0
  173. data/test/new_relic/transaction_sample/segment_test.rb +389 -0
  174. data/test/new_relic/transaction_sample/summary_segment_test.rb +31 -0
  175. data/test/new_relic/transaction_sample_subtest_test.rb +56 -0
  176. data/test/new_relic/transaction_sample_test.rb +164 -0
  177. data/test/new_relic/version_number_test.rb +89 -0
  178. data/test/test_contexts.rb +29 -0
  179. data/test/test_helper.rb +154 -0
  180. data/ui/helpers/developer_mode_helper.rb +357 -0
  181. data/ui/helpers/google_pie_chart.rb +48 -0
  182. data/ui/views/layouts/newrelic_default.rhtml +47 -0
  183. data/ui/views/newrelic/_explain_plans.rhtml +27 -0
  184. data/ui/views/newrelic/_sample.rhtml +20 -0
  185. data/ui/views/newrelic/_segment.rhtml +28 -0
  186. data/ui/views/newrelic/_segment_limit_message.rhtml +1 -0
  187. data/ui/views/newrelic/_segment_row.rhtml +12 -0
  188. data/ui/views/newrelic/_show_sample_detail.rhtml +24 -0
  189. data/ui/views/newrelic/_show_sample_sql.rhtml +24 -0
  190. data/ui/views/newrelic/_show_sample_summary.rhtml +3 -0
  191. data/ui/views/newrelic/_sql_row.rhtml +16 -0
  192. data/ui/views/newrelic/_stack_trace.rhtml +15 -0
  193. data/ui/views/newrelic/_table.rhtml +12 -0
  194. data/ui/views/newrelic/explain_sql.rhtml +43 -0
  195. data/ui/views/newrelic/file/images/arrow-close.png +0 -0
  196. data/ui/views/newrelic/file/images/arrow-open.png +0 -0
  197. data/ui/views/newrelic/file/images/blue_bar.gif +0 -0
  198. data/ui/views/newrelic/file/images/file_icon.png +0 -0
  199. data/ui/views/newrelic/file/images/gray_bar.gif +0 -0
  200. data/ui/views/newrelic/file/images/new-relic-rpm-desktop.gif +0 -0
  201. data/ui/views/newrelic/file/images/new_relic_rpm_desktop.gif +0 -0
  202. data/ui/views/newrelic/file/images/textmate.png +0 -0
  203. data/ui/views/newrelic/file/javascript/jquery-1.4.2.js +6240 -0
  204. data/ui/views/newrelic/file/javascript/transaction_sample.js +120 -0
  205. data/ui/views/newrelic/file/stylesheets/style.css +490 -0
  206. data/ui/views/newrelic/index.rhtml +71 -0
  207. data/ui/views/newrelic/sample_not_found.rhtml +2 -0
  208. data/ui/views/newrelic/show_sample.rhtml +80 -0
  209. data/ui/views/newrelic/show_source.rhtml +3 -0
  210. data/ui/views/newrelic/threads.rhtml +53 -0
  211. data/vendor/gems/dependency_detection-0.0.1.build/LICENSE +5 -0
  212. data/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection/version.rb +3 -0
  213. data/vendor/gems/dependency_detection-0.0.1.build/lib/dependency_detection.rb +62 -0
  214. data/vendor/gems/metric_parser-0.1.0.pre1/lib/metric_parser.rb +1 -0
  215. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/action_mailer.rb +14 -0
  216. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_merchant.rb +31 -0
  217. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/active_record.rb +33 -0
  218. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/apdex.rb +89 -0
  219. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/background_transaction.rb +7 -0
  220. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb +46 -0
  221. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller.rb +67 -0
  222. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_cpu.rb +43 -0
  223. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/controller_ext.rb +17 -0
  224. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database.rb +48 -0
  225. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/database_pool.rb +24 -0
  226. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net.rb +28 -0
  227. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/dot_net_parser.rb +17 -0
  228. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/errors.rb +11 -0
  229. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb +55 -0
  230. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/frontend.rb +40 -0
  231. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/gc.rb +20 -0
  232. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/hibernate_session.rb +7 -0
  233. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java.rb +31 -0
  234. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/java_parser.rb +17 -0
  235. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp.rb +34 -0
  236. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/jsp_tag.rb +7 -0
  237. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/mem_cache.rb +55 -0
  238. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/metric_parser.rb +122 -0
  239. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/orm.rb +27 -0
  240. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/other_transaction.rb +40 -0
  241. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet.rb +7 -0
  242. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_context_listener.rb +7 -0
  243. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/servlet_filter.rb +7 -0
  244. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr.rb +27 -0
  245. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/solr_request_handler.rb +15 -0
  246. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring.rb +54 -0
  247. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring_controller.rb +6 -0
  248. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/spring_view.rb +6 -0
  249. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_action.rb +20 -0
  250. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/struts_result.rb +20 -0
  251. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/version.rb +5 -0
  252. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/view.rb +70 -0
  253. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_frontend.rb +18 -0
  254. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_service.rb +14 -0
  255. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/web_transaction.rb +133 -0
  256. data/vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser.rb +64 -0
  257. metadata +398 -0
data/newrelic.yml ADDED
@@ -0,0 +1,265 @@
1
+ #
2
+ # This file configures the New Relic Ruby Agent, New Relic monitors
3
+ # Rails applications with deep visibility and low overhead. For more
4
+ # information, visit www.newrelic.com
5
+ #
6
+ # Generated <%= Time.now.strftime('%B %d, %Y') %>, for version <%= NewRelic::VERSION::STRING %>
7
+ #
8
+ # <%= generated_for_user %>
9
+
10
+
11
+ # Here are the settings that are common to all environments
12
+ common: &default_settings
13
+ # ============================== LICENSE KEY ===============================
14
+
15
+ # You must specify the license key associated with your New Relic
16
+ # account. This key binds your Agent's data to your account in the
17
+ # New Relic service.
18
+ license_key: '<%= license_key %>'
19
+
20
+ # Agent Enabled (Rails Only)
21
+ # Use this setting to force the agent to run or not run.
22
+ # Default is 'auto' which means the agent will install and run only
23
+ # if a valid dispatcher such as Mongrel is running. This prevents
24
+ # it from running with Rake or the console. Set to false to
25
+ # completely turn the agent off regardless of the other settings.
26
+ # Valid values are true, false and auto.
27
+ #
28
+ # agent_enabled: auto
29
+
30
+ # Application Name Set this to be the name of your application as
31
+ # you'd like it show up in New Relic. The service will then auto-map
32
+ # instances of your application into an "application" on your
33
+ # dashboard page. If you want to map this instance into multiple
34
+ # apps, like "AJAX Requests" and "All UI" then specify a semicolon
35
+ # separated list of up to three distinct names, or a yaml list.
36
+ # Defaults to the capitalized RAILS_ENV or RACK_ENV (i.e.,
37
+ # Production, Staging, etc)
38
+ #
39
+ # Example:
40
+ #
41
+ # app_name:
42
+ # - Ajax Service
43
+ # - All Services
44
+ #
45
+ app_name: <%= @app_name %>
46
+
47
+ # When "true", the agent collects performance data about your
48
+ # application and reports this data to the New Relic service at
49
+ # newrelic.com. This global switch is normally overridden for each
50
+ # environment below. (formerly called 'enabled')
51
+ monitor_mode: true
52
+
53
+ # Developer mode should be off in every environment but
54
+ # development as it has very high overhead in memory.
55
+ developer_mode: false
56
+
57
+ # The newrelic agent generates its own log file to keep its logging
58
+ # information separate from that of your application. Specify its
59
+ # log level here.
60
+ log_level: info
61
+
62
+ # Optionally set the path to the log file This is expanded from the
63
+ # root directory (may be relative or absolute, e.g. 'log/' or
64
+ # '/var/log/') The agent will attempt to create this directory if it
65
+ # does not exist.
66
+ # log_file_path: 'log'
67
+
68
+ # Optionally set the name of the log file, defaults to 'newrelic_agent.log'
69
+ # log_file_name: 'newrelic_agent.log'
70
+
71
+ # The newrelic agent communicates with the service via http by
72
+ # default. If you want to communicate via https to increase
73
+ # security, then turn on SSL by setting this value to true. Note,
74
+ # this will result in increased CPU overhead to perform the
75
+ # encryption involved in SSL communication, but this work is done
76
+ # asynchronously to the threads that process your application code,
77
+ # so it should not impact response times.
78
+ ssl: false
79
+
80
+ # EXPERIMENTAL: enable verification of the SSL certificate sent by
81
+ # the server. This setting has no effect unless SSL is enabled
82
+ # above. This may block your application. Only enable it if the data
83
+ # you send us needs end-to-end verified certificates.
84
+ #
85
+ # This means we cannot cache the DNS lookup, so each request to the
86
+ # service will perform a lookup. It also means that we cannot
87
+ # use a non-blocking lookup, so in a worst case, if you have DNS
88
+ # problems, your app may block indefinitely.
89
+ # verify_certificate: true
90
+
91
+ # Set your application's Apdex threshold value with the 'apdex_t'
92
+ # setting, in seconds. The apdex_t value determines the buckets used
93
+ # to compute your overall Apdex score.
94
+ # Requests that take less than apdex_t seconds to process will be
95
+ # classified as Satisfying transactions; more than apdex_t seconds
96
+ # as Tolerating transactions; and more than four times the apdex_t
97
+ # value as Frustrating transactions.
98
+ # For more about the Apdex standard, see
99
+ # http://newrelic.com/docs/general/apdex
100
+
101
+ apdex_t: 0.5
102
+
103
+ #============================== Browser Monitoring ===============================
104
+ # New Relic Real User Monitoring gives you insight into the performance real users are
105
+ # experiencing with your website. This is accomplished by measuring the time it takes for
106
+ # your users' browsers to download and render your web pages by injecting a small amount
107
+ # of JavaScript code into the header and footer of each page.
108
+ browser_monitoring:
109
+ # By default the agent automatically injects the monitoring JavaScript
110
+ # into web pages. Set this attribute to false to turn off this behavior.
111
+ auto_instrument: true
112
+
113
+ # Proxy settings for connecting to the service.
114
+ #
115
+ # If a proxy is used, the host setting is required. Other settings
116
+ # are optional. Default port is 8080.
117
+ #
118
+ # proxy_host: hostname
119
+ # proxy_port: 8080
120
+ # proxy_user:
121
+ # proxy_pass:
122
+
123
+
124
+ # Tells transaction tracer and error collector (when enabled)
125
+ # whether or not to capture HTTP params. When true, frameworks can
126
+ # exclude HTTP parameters from being captured.
127
+ # Rails: the RoR filter_parameter_logging excludes parameters
128
+ # Java: create a config setting called "ignored_params" and set it to
129
+ # a comma separated list of HTTP parameter names.
130
+ # ex: ignored_params: credit_card, ssn, password
131
+ capture_params: false
132
+
133
+
134
+ # Transaction tracer captures deep information about slow
135
+ # transactions and sends this to the service once a
136
+ # minute. Included in the transaction is the exact call sequence of
137
+ # the transactions including any SQL statements issued.
138
+ transaction_tracer:
139
+
140
+ # Transaction tracer is enabled by default. Set this to false to
141
+ # turn it off. This feature is only available at the Professional
142
+ # and above product levels.
143
+ enabled: true
144
+
145
+ # Threshold in seconds for when to collect a transaction
146
+ # trace. When the response time of a controller action exceeds
147
+ # this threshold, a transaction trace will be recorded and sent to
148
+ # the service. Valid values are any float value, or (default)
149
+ # "apdex_f", which will use the threshold for an dissatisfying
150
+ # Apdex controller action - four times the Apdex T value.
151
+ transaction_threshold: apdex_f
152
+
153
+ # When transaction tracer is on, SQL statements can optionally be
154
+ # recorded. The recorder has three modes, "off" which sends no
155
+ # SQL, "raw" which sends the SQL statement in its original form,
156
+ # and "obfuscated", which strips out numeric and string literals
157
+ record_sql: obfuscated
158
+
159
+ # Threshold in seconds for when to collect stack trace for a SQL
160
+ # call. In other words, when SQL statements exceed this threshold,
161
+ # then capture and send the current stack trace. This is
162
+ # helpful for pinpointing where long SQL calls originate from
163
+ stack_trace_threshold: 0.500
164
+
165
+ # Determines whether the agent will capture query plans for slow
166
+ # SQL queries. Only supported in mysql and postgres. Should be
167
+ # set to false when using other adapters.
168
+ # explain_enabled: true
169
+
170
+ # Threshold for query execution time below which query plans will not
171
+ # not be captured. Relevant only when `explain_enabled` is true.
172
+ # explain_threshold: 0.5
173
+
174
+ # Error collector captures information about uncaught exceptions and
175
+ # sends them to the service for viewing
176
+ error_collector:
177
+
178
+ # Error collector is enabled by default. Set this to false to turn
179
+ # it off. This feature is only available at the Professional and above
180
+ # product levels
181
+ enabled: true
182
+
183
+ # Rails Only - tells error collector whether or not to capture a
184
+ # source snippet around the place of the error when errors are View
185
+ # related.
186
+ capture_source: true
187
+
188
+ # To stop specific errors from reporting to New Relic, set this property
189
+ # to comma separated values. Default is to ignore routing errors
190
+ # which are how 404's get triggered.
191
+ #
192
+ ignore_errors: ActionController::RoutingError
193
+
194
+ # (Advanced) Uncomment this to ensure the cpu and memory samplers
195
+ # won't run. Useful when you are using the agent to monitor an
196
+ # external resource
197
+ # disable_samplers: true
198
+
199
+ # If you aren't interested in visibility in these areas, you can
200
+ # disable the instrumentation to reduce overhead.
201
+ #
202
+ # disable_view_instrumentation: true
203
+ # disable_activerecord_instrumentation: true
204
+ # disable_memcache_instrumentation: true
205
+ # disable_dj: true
206
+
207
+ # If you're interested in capturing memcache keys as though they
208
+ # were SQL uncomment this flag. Note that this does increase
209
+ # overhead slightly on every memcached call, and can have security
210
+ # implications if your memcached keys are sensitive
211
+ # capture_memcache_keys: true
212
+
213
+ # Certain types of instrumentation such as GC stats will not work if
214
+ # you are running multi-threaded. Please let us know.
215
+ # multi_threaded = false
216
+
217
+ # Application Environments
218
+ # ------------------------------------------
219
+ # Environment specific settings are in this section.
220
+ # For Rails applications, RAILS_ENV is used to determine the environment
221
+ # For Java applications, pass -Dnewrelic.environment <environment> to set
222
+ # the environment
223
+
224
+ # NOTE if your application has other named environments, you should
225
+ # provide newrelic configuration settings for these environments here.
226
+
227
+ development:
228
+ <<: *default_settings
229
+ # Turn off communication to New Relic service in development mode (also
230
+ # 'enabled').
231
+ # NOTE: for initial evaluation purposes, you may want to temporarily
232
+ # turn the agent on in development mode.
233
+ monitor_mode: false
234
+
235
+ # Rails Only - when running in Developer Mode, the New Relic Agent will
236
+ # present performance information on the last 100 transactions you have
237
+ # executed since starting the mongrel.
238
+ # NOTE: There is substantial overhead when running in developer mode.
239
+ # Do not use for production or load testing.
240
+ developer_mode: true
241
+
242
+ # Enable textmate links
243
+ # textmate: true
244
+
245
+ test:
246
+ <<: *default_settings
247
+ # It almost never makes sense to turn on the agent when running
248
+ # unit, functional or integration tests or the like.
249
+ monitor_mode: false
250
+
251
+ # Turn on the agent in production for 24x7 monitoring. NewRelic
252
+ # testing shows an average performance impact of < 5 ms per
253
+ # transaction, you you can leave this on all the time without
254
+ # incurring any user-visible performance degradation.
255
+ production:
256
+ <<: *default_settings
257
+ monitor_mode: true
258
+
259
+ # Many applications have a staging environment which behaves
260
+ # identically to production. Support for that environment is provided
261
+ # here. By default, the staging environment has the agent turned on.
262
+ staging:
263
+ <<: *default_settings
264
+ monitor_mode: true
265
+ app_name: <%= @app_name %> (Staging)
@@ -0,0 +1,6 @@
1
+ # The capistrano recipes in plugins are automatically
2
+ # loaded from here. From gems, they are available from
3
+ # the lib directory. We have to make them available from
4
+ # both locations
5
+
6
+ require File.join(File.dirname(__FILE__),'..','lib','new_relic','recipes')
@@ -0,0 +1,77 @@
1
+ # Some test models
2
+ # These will get created and dropped during the active record tests
3
+ # Be sure and call setup and teardown
4
+ module ActiveRecordFixtures
5
+ extend self
6
+ def setup
7
+ ActiveRecordFixtures::Order.setup
8
+ ActiveRecordFixtures::Shipment.setup
9
+ end
10
+ def teardown
11
+ ActiveRecordFixtures::Shipment.teardown
12
+ ActiveRecordFixtures::Order.teardown
13
+ begin
14
+ super
15
+ rescue Exception => e
16
+ end
17
+ end
18
+ class Order < ActiveRecord::Base
19
+ self.table_name = 'newrelic_test_orders'
20
+ has_and_belongs_to_many :shipments, :class_name => 'ActiveRecordFixtures::Shipment'
21
+ def self.setup
22
+ unless check_for_table
23
+ connection.create_table self.table_name, :force => true do |t|
24
+ t.column :name, :string
25
+ end
26
+ else
27
+ connection.execute("delete from #{self.table_name}")
28
+ end
29
+ end
30
+
31
+ def self.check_for_table
32
+ connection.table_exists?(self.table_name)
33
+ rescue Exception => e
34
+ false
35
+ end
36
+
37
+ def self.add_delay
38
+ # Introduce a 5 ms delay into db operations on Orders
39
+ def connection.log_info *args
40
+ sleep 0.005
41
+ super *args
42
+ end
43
+ end
44
+ def self.teardown
45
+ def connection.log_info *args
46
+ super *args
47
+ end
48
+ end
49
+ end
50
+
51
+ class Shipment < ActiveRecord::Base
52
+ self.table_name = 'newrelic_test_shipment'
53
+ has_and_belongs_to_many :orders, :class_name => 'ActiveRecordFixtures::Order'
54
+ def self.setup
55
+ unless check_for_table
56
+ connection.create_table self.table_name, :force => true do |t|
57
+ # no other columns
58
+ end
59
+ connection.create_table 'orders_shipments', :force => true, :id => false do |t|
60
+ t.column :order_id, :integer
61
+ t.column :shipment_id, :integer
62
+ end
63
+ else
64
+ connection.execute("delete from #{self.table_name}")
65
+ end
66
+ end
67
+ def self.check_for_table
68
+ connection.table_exists?(self.table_name) && connection.table_exists?('orders_shipments')
69
+ rescue Exception => e
70
+ false
71
+ end
72
+
73
+
74
+ def self.teardown
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,48 @@
1
+ # This is the config file loaded when running unit tests locally.
2
+ common: &default_settings
3
+ transaction_tracer:
4
+ enabled: true
5
+ record_sql: raw
6
+
7
+ test:
8
+ <<: *default_settings
9
+ host: localhost
10
+ port: 3000
11
+ log_level: info
12
+ capture_params: true
13
+ agent_enabled: false
14
+ monitor_mode: false
15
+ developer_mode: true
16
+ disable_samplers: true
17
+ api_host: 127.0.0.1
18
+ api_port: 443
19
+ message: '<%= generated_for_user %>'
20
+ license_key: '<%= license_key %>'
21
+ agent_enabled: auto
22
+ apdex_t: 1.1
23
+ app_name:
24
+ - a
25
+ - b
26
+ - c
27
+ log_file_path: <%= ::Rails::VERSION::MAJOR == 3 ? Rails.root : RAILS_ROOT %>/log
28
+
29
+ # Some fixtures for newrelic.yml parsing tests
30
+ erb_value: <%= 'hey'*3 %>
31
+ tval: true
32
+ tstring: 'true'
33
+ fval: false
34
+ yval: yes
35
+ sval: sure
36
+
37
+ transaction_tracer:
38
+ record_sql: raw
39
+ transaction_threshold: Apdex_f # case insensitive
40
+ explain_threshold: 0.1
41
+ explain_enabled: true
42
+ stack_trace_threshold: 0.1
43
+
44
+ error_collector:
45
+ enabled: true
46
+ capture_source: true
47
+
48
+
@@ -0,0 +1,48 @@
1
+ require 'new_relic/control/frameworks/rails'
2
+ require 'new_relic/control/frameworks/rails3'
3
+
4
+ if defined?(Rails) && Rails.respond_to?(:version) && Rails.version.to_i == 3
5
+ parent_class = NewRelic::Control::Frameworks::Rails3
6
+ else
7
+ parent_class = NewRelic::Control::Frameworks::Rails
8
+ end
9
+
10
+
11
+ class NewRelic::Control::Frameworks::Test < parent_class
12
+ def env
13
+ 'test'
14
+ end
15
+ def app
16
+ if defined?(Rails) && Rails.respond_to?(:version) && Rails.version.to_i == 3
17
+ :rails3
18
+ else
19
+ :rails
20
+ end
21
+ end
22
+
23
+ def initialize *args
24
+ super
25
+ setup_log
26
+ end
27
+ # when running tests, don't write out stderr
28
+ def log!(msg, level=:info)
29
+ log.send level, msg if log
30
+ end
31
+
32
+ # Add the default route in case it's missing. Need it for testing.
33
+ def install_devmode_route
34
+ super
35
+ ActionController::Routing::RouteSet.class_eval do
36
+ return if defined? draw_without_test_route
37
+ def draw_with_test_route
38
+ draw_without_test_route do | map |
39
+ map.connect ':controller/:action/:id'
40
+ yield map
41
+ end
42
+ end
43
+ alias_method_chain :draw, :test_route
44
+ end
45
+ # Force the routes to be reloaded
46
+ ActionController::Routing::Routes.reload!
47
+ end
48
+ end