newrelic_rpm 2.10.6 → 2.10.8

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 (220) hide show
  1. data/CHANGELOG +14 -0
  2. data/lib/new_relic/agent.rb +5 -4
  3. data/lib/new_relic/agent/agent.rb +81 -101
  4. data/lib/new_relic/agent/error_collector.rb +1 -2
  5. data/lib/new_relic/agent/instrumentation/authlogic.rb +2 -2
  6. data/lib/new_relic/agent/instrumentation/merb/controller.rb +2 -2
  7. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +45 -0
  8. data/lib/new_relic/agent/instrumentation/rails3/errors.rb +21 -0
  9. data/lib/new_relic/agent/method_tracer.rb +2 -2
  10. data/lib/new_relic/agent/samplers/delayed_job_lock_sampler.rb +1 -1
  11. data/lib/new_relic/agent/stats_engine/samplers.rb +1 -2
  12. data/lib/new_relic/agent/transaction_sampler.rb +1 -1
  13. data/lib/new_relic/agent/worker_loop.rb +47 -86
  14. data/lib/new_relic/{agent/collection_helper.rb → collection_helper.rb} +2 -4
  15. data/lib/new_relic/control.rb +18 -2
  16. data/lib/new_relic/control/rails3.rb +75 -0
  17. data/lib/new_relic/local_environment.rb +11 -3
  18. data/lib/new_relic/noticed_error.rb +2 -1
  19. data/lib/new_relic/version.rb +10 -9
  20. data/newrelic_rpm.gemspec +195 -3
  21. data/rdoc/classes/NewRelic.html +293 -0
  22. data/rdoc/classes/NewRelic/Agent.html +810 -0
  23. data/rdoc/classes/NewRelic/Agent/Agent.html +742 -0
  24. data/rdoc/classes/NewRelic/Agent/BackgroundLoadingError.html +111 -0
  25. data/rdoc/classes/NewRelic/Agent/BusyCalculator.html +309 -0
  26. data/rdoc/classes/NewRelic/Agent/CollectionHelper.html +196 -0
  27. data/rdoc/classes/NewRelic/Agent/ErrorCollector.html +378 -0
  28. data/rdoc/classes/NewRelic/Agent/ForceDisconnectException.html +118 -0
  29. data/rdoc/classes/NewRelic/Agent/ForceRestartException.html +117 -0
  30. data/rdoc/classes/NewRelic/Agent/IgnoreSilentlyException.html +118 -0
  31. data/rdoc/classes/NewRelic/Agent/Instrumentation.html +174 -0
  32. data/rdoc/classes/NewRelic/Agent/Instrumentation/ActiveRecordInstrumentation.html +221 -0
  33. data/rdoc/classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation.html +349 -0
  34. data/rdoc/classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation/ClassMethods.html +277 -0
  35. data/rdoc/classes/NewRelic/Agent/Instrumentation/DelayedJobInstrumentation.html +112 -0
  36. data/rdoc/classes/NewRelic/Agent/Instrumentation/MetricFrame.html +1007 -0
  37. data/rdoc/classes/NewRelic/Agent/Instrumentation/Rack.html +321 -0
  38. data/rdoc/classes/NewRelic/Agent/Instrumentation/Sinatra.html +176 -0
  39. data/rdoc/classes/NewRelic/Agent/LicenseException.html +117 -0
  40. data/rdoc/classes/NewRelic/Agent/MethodTracer.html +150 -0
  41. data/rdoc/classes/NewRelic/Agent/MethodTracer/ClassMethods.html +295 -0
  42. data/rdoc/classes/NewRelic/Agent/MethodTracer/InstanceMethods.html +284 -0
  43. data/rdoc/classes/NewRelic/Agent/PostTooBigException.html +120 -0
  44. data/rdoc/classes/NewRelic/Agent/Sampler.html +314 -0
  45. data/rdoc/classes/NewRelic/Agent/Sampler/Unsupported.html +117 -0
  46. data/rdoc/classes/NewRelic/Agent/Samplers.html +126 -0
  47. data/rdoc/classes/NewRelic/Agent/Samplers/CpuSampler.html +327 -0
  48. data/rdoc/classes/NewRelic/Agent/Samplers/DelayedJobLockSampler.html +296 -0
  49. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler.html +321 -0
  50. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/Base.html +186 -0
  51. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/JavaHeapSampler.html +173 -0
  52. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/ProcStatus.html +216 -0
  53. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/ShellPS.html +207 -0
  54. data/rdoc/classes/NewRelic/Agent/Samplers/ObjectSampler.html +222 -0
  55. data/rdoc/classes/NewRelic/Agent/ServerError.html +117 -0
  56. data/rdoc/classes/NewRelic/Agent/ShimAgent.html +297 -0
  57. data/rdoc/classes/NewRelic/Agent/StatsEngine.html +204 -0
  58. data/rdoc/classes/NewRelic/Agent/StatsEngine/MetricStats.html +441 -0
  59. data/rdoc/classes/NewRelic/Agent/StatsEngine/Samplers.html +237 -0
  60. data/rdoc/classes/NewRelic/Agent/StatsEngine/ScopeStackElement.html +178 -0
  61. data/rdoc/classes/NewRelic/Agent/StatsEngine/Transactions.html +385 -0
  62. data/rdoc/classes/NewRelic/Agent/TransactionSampleBuilder.html +505 -0
  63. data/rdoc/classes/NewRelic/Agent/TransactionSampler.html +690 -0
  64. data/rdoc/classes/NewRelic/Agent/WorkerLoop.html +305 -0
  65. data/rdoc/classes/NewRelic/Agent/WorkerLoop/LoopTask.html +224 -0
  66. data/rdoc/classes/NewRelic/ApdexStats.html +196 -0
  67. data/rdoc/classes/NewRelic/BasicStats.html +113 -0
  68. data/rdoc/classes/NewRelic/ChainedCall.html +180 -0
  69. data/rdoc/classes/NewRelic/Commands.html +112 -0
  70. data/rdoc/classes/NewRelic/Commands/CommandFailure.html +167 -0
  71. data/rdoc/classes/NewRelic/Commands/Deployments.html +285 -0
  72. data/rdoc/classes/NewRelic/Control.html +1760 -0
  73. data/rdoc/classes/NewRelic/Control/External.html +148 -0
  74. data/rdoc/classes/NewRelic/Control/Merb.html +227 -0
  75. data/rdoc/classes/NewRelic/Control/Rails.html +542 -0
  76. data/rdoc/classes/NewRelic/Control/Ruby.html +266 -0
  77. data/rdoc/classes/NewRelic/Control/Sinatra.html +178 -0
  78. data/rdoc/classes/NewRelic/DelayedJobInjection.html +118 -0
  79. data/rdoc/classes/NewRelic/Histogram.html +226 -0
  80. data/rdoc/classes/NewRelic/Histogram/Bucket.html +319 -0
  81. data/rdoc/classes/NewRelic/Histogram/Shim.html +144 -0
  82. data/rdoc/classes/NewRelic/LocalEnvironment.html +572 -0
  83. data/rdoc/classes/NewRelic/MerbBootLoader.html +146 -0
  84. data/rdoc/classes/NewRelic/MethodTraceStats.html +250 -0
  85. data/rdoc/classes/NewRelic/MetricData.html +347 -0
  86. data/rdoc/classes/NewRelic/MetricParser.html +747 -0
  87. data/rdoc/classes/NewRelic/MetricParser/ActionMailer.html +170 -0
  88. data/rdoc/classes/NewRelic/MetricParser/ActiveMerchant.html +267 -0
  89. data/rdoc/classes/NewRelic/MetricParser/ActiveRecord.html +250 -0
  90. data/rdoc/classes/NewRelic/MetricParser/Controller.html +363 -0
  91. data/rdoc/classes/NewRelic/MetricParser/ControllerCPU.html +319 -0
  92. data/rdoc/classes/NewRelic/MetricParser/Errors.html +170 -0
  93. data/rdoc/classes/NewRelic/MetricParser/External.html +339 -0
  94. data/rdoc/classes/NewRelic/MetricParser/MemCache.html +340 -0
  95. data/rdoc/classes/NewRelic/MetricParser/OtherTransaction.html +205 -0
  96. data/rdoc/classes/NewRelic/MetricParser/View.html +381 -0
  97. data/rdoc/classes/NewRelic/MetricParser/WebFrontend.html +182 -0
  98. data/rdoc/classes/NewRelic/MetricParser/WebService.html +172 -0
  99. data/rdoc/classes/NewRelic/MetricSpec.html +406 -0
  100. data/rdoc/classes/NewRelic/Metrics.html +138 -0
  101. data/rdoc/classes/NewRelic/NoticedError.html +200 -0
  102. data/rdoc/classes/NewRelic/Rack.html +112 -0
  103. data/rdoc/classes/NewRelic/Rack/MetricApp.html +193 -0
  104. data/rdoc/classes/NewRelic/Rack/Status.html +165 -0
  105. data/rdoc/classes/NewRelic/ScopedMethodTraceStats.html +225 -0
  106. data/rdoc/classes/NewRelic/Stats.html +917 -0
  107. data/rdoc/classes/NewRelic/StatsBase.html +346 -0
  108. data/rdoc/classes/NewRelic/TransactionAnalysis.html +269 -0
  109. data/rdoc/classes/NewRelic/TransactionAnalysis/SegmentSummary.html +338 -0
  110. data/rdoc/classes/NewRelic/TransactionSample.html +766 -0
  111. data/rdoc/classes/NewRelic/TransactionSample/CompositeSegment.html +195 -0
  112. data/rdoc/classes/NewRelic/TransactionSample/FakeSegment.html +113 -0
  113. data/rdoc/classes/NewRelic/TransactionSample/IDGenerator.html +178 -0
  114. data/rdoc/classes/NewRelic/TransactionSample/Segment.html +920 -0
  115. data/rdoc/classes/NewRelic/TransactionSample/SummarySegment.html +180 -0
  116. data/rdoc/classes/NewRelic/VersionNumber.html +338 -0
  117. data/rdoc/classes/NewRelicApi.html +270 -0
  118. data/rdoc/classes/NewRelicApi/Account.html +178 -0
  119. data/rdoc/classes/NewRelicApi/Account/AccountUsage.html +111 -0
  120. data/rdoc/classes/NewRelicApi/Account/AccountView.html +146 -0
  121. data/rdoc/classes/NewRelicApi/Application.html +139 -0
  122. data/rdoc/classes/NewRelicApi/Application/Agent.html +119 -0
  123. data/rdoc/classes/NewRelicApi/Deployment.html +123 -0
  124. data/rdoc/classes/NewRelicApi/Subscription.html +111 -0
  125. data/rdoc/classes/NewRelicApi/ThresholdValue.html +174 -0
  126. data/rdoc/classes/NewRelicApi/User.html +111 -0
  127. data/rdoc/created.rid +1 -0
  128. data/rdoc/files/CHANGELOG.html +649 -0
  129. data/rdoc/files/LICENSE.html +143 -0
  130. data/rdoc/files/lib/new_relic/agent/agent_rb.html +113 -0
  131. data/rdoc/files/lib/new_relic/agent/busy_calculator_rb.html +115 -0
  132. data/rdoc/files/lib/new_relic/agent/chained_call_rb.html +107 -0
  133. data/rdoc/files/lib/new_relic/agent/collection_helper_rb.html +101 -0
  134. data/rdoc/files/lib/new_relic/agent/error_collector_rb.html +101 -0
  135. data/rdoc/files/lib/new_relic/agent/instrumentation/active_merchant_rb.html +107 -0
  136. data/rdoc/files/lib/new_relic/agent/instrumentation/active_record_instrumentation_rb.html +108 -0
  137. data/rdoc/files/lib/new_relic/agent/instrumentation/authlogic_rb.html +101 -0
  138. data/rdoc/files/lib/new_relic/agent/instrumentation/controller_instrumentation_rb.html +108 -0
  139. data/rdoc/files/lib/new_relic/agent/instrumentation/data_mapper_rb.html +191 -0
  140. data/rdoc/files/lib/new_relic/agent/instrumentation/delayed_job_instrumentation_rb.html +109 -0
  141. data/rdoc/files/lib/new_relic/agent/instrumentation/memcache_rb.html +152 -0
  142. data/rdoc/files/lib/new_relic/agent/instrumentation/merb/controller_rb.html +155 -0
  143. data/rdoc/files/lib/new_relic/agent/instrumentation/merb/errors_rb.html +107 -0
  144. data/rdoc/files/lib/new_relic/agent/instrumentation/metric_frame_rb.html +113 -0
  145. data/rdoc/files/lib/new_relic/agent/instrumentation/net_rb.html +172 -0
  146. data/rdoc/files/lib/new_relic/agent/instrumentation/passenger_instrumentation_rb.html +101 -0
  147. data/rdoc/files/lib/new_relic/agent/instrumentation/rack_rb.html +108 -0
  148. data/rdoc/files/lib/new_relic/agent/instrumentation/rails/action_controller_rb.html +152 -0
  149. data/rdoc/files/lib/new_relic/agent/instrumentation/rails/action_web_service_rb.html +108 -0
  150. data/rdoc/files/lib/new_relic/agent/instrumentation/rails/errors_rb.html +167 -0
  151. data/rdoc/files/lib/new_relic/agent/instrumentation/sinatra_rb.html +108 -0
  152. data/rdoc/files/lib/new_relic/agent/method_tracer_rb.html +108 -0
  153. data/rdoc/files/lib/new_relic/agent/sampler_rb.html +116 -0
  154. data/rdoc/files/lib/new_relic/agent/samplers/cpu_sampler_rb.html +101 -0
  155. data/rdoc/files/lib/new_relic/agent/samplers/delayed_job_lock_sampler_rb.html +101 -0
  156. data/rdoc/files/lib/new_relic/agent/samplers/memory_sampler_rb.html +101 -0
  157. data/rdoc/files/lib/new_relic/agent/samplers/object_sampler_rb.html +101 -0
  158. data/rdoc/files/lib/new_relic/agent/shim_agent_rb.html +108 -0
  159. data/rdoc/files/lib/new_relic/agent/stats_engine/metric_stats_rb.html +101 -0
  160. data/rdoc/files/lib/new_relic/agent/stats_engine/samplers_rb.html +101 -0
  161. data/rdoc/files/lib/new_relic/agent/stats_engine/transactions_rb.html +101 -0
  162. data/rdoc/files/lib/new_relic/agent/stats_engine_rb.html +110 -0
  163. data/rdoc/files/lib/new_relic/agent/transaction_sampler_rb.html +101 -0
  164. data/rdoc/files/lib/new_relic/agent/worker_loop_rb.html +101 -0
  165. data/rdoc/files/lib/new_relic/agent_rb.html +204 -0
  166. data/rdoc/files/lib/new_relic/commands/deployments_rb.html +119 -0
  167. data/rdoc/files/lib/new_relic/commands/new_relic_commands_rb.html +108 -0
  168. data/rdoc/files/lib/new_relic/control/external_rb.html +117 -0
  169. data/rdoc/files/lib/new_relic/control/merb_rb.html +101 -0
  170. data/rdoc/files/lib/new_relic/control/rails_rb.html +108 -0
  171. data/rdoc/files/lib/new_relic/control/ruby_rb.html +110 -0
  172. data/rdoc/files/lib/new_relic/control/sinatra_rb.html +108 -0
  173. data/rdoc/files/lib/new_relic/control_rb.html +116 -0
  174. data/rdoc/files/lib/new_relic/delayed_job_injection_rb.html +180 -0
  175. data/rdoc/files/lib/new_relic/histogram_rb.html +114 -0
  176. data/rdoc/files/lib/new_relic/local_environment_rb.html +111 -0
  177. data/rdoc/files/lib/new_relic/merbtasks_rb.html +101 -0
  178. data/rdoc/files/lib/new_relic/metric_data_rb.html +101 -0
  179. data/rdoc/files/lib/new_relic/metric_parser/action_mailer_rb.html +101 -0
  180. data/rdoc/files/lib/new_relic/metric_parser/active_merchant_rb.html +101 -0
  181. data/rdoc/files/lib/new_relic/metric_parser/active_record_rb.html +101 -0
  182. data/rdoc/files/lib/new_relic/metric_parser/controller_cpu_rb.html +101 -0
  183. data/rdoc/files/lib/new_relic/metric_parser/controller_rb.html +101 -0
  184. data/rdoc/files/lib/new_relic/metric_parser/errors_rb.html +101 -0
  185. data/rdoc/files/lib/new_relic/metric_parser/external_rb.html +101 -0
  186. data/rdoc/files/lib/new_relic/metric_parser/mem_cache_rb.html +101 -0
  187. data/rdoc/files/lib/new_relic/metric_parser/other_transaction_rb.html +108 -0
  188. data/rdoc/files/lib/new_relic/metric_parser/view_rb.html +101 -0
  189. data/rdoc/files/lib/new_relic/metric_parser/web_frontend_rb.html +107 -0
  190. data/rdoc/files/lib/new_relic/metric_parser/web_service_rb.html +101 -0
  191. data/rdoc/files/lib/new_relic/metric_parser_rb.html +101 -0
  192. data/rdoc/files/lib/new_relic/metric_spec_rb.html +108 -0
  193. data/rdoc/files/lib/new_relic/metrics_rb.html +101 -0
  194. data/rdoc/files/lib/new_relic/noticed_error_rb.html +107 -0
  195. data/rdoc/files/lib/new_relic/rack/metric_app_rb.html +108 -0
  196. data/rdoc/files/lib/new_relic/rack_app_rb.html +110 -0
  197. data/rdoc/files/lib/new_relic/recipes_rb.html +128 -0
  198. data/rdoc/files/lib/new_relic/stats_rb.html +101 -0
  199. data/rdoc/files/lib/new_relic/transaction_analysis_rb.html +108 -0
  200. data/rdoc/files/lib/new_relic/transaction_sample_rb.html +101 -0
  201. data/rdoc/files/lib/new_relic/version_rb.html +101 -0
  202. data/rdoc/files/lib/new_relic_api_rb.html +145 -0
  203. data/rdoc/files/lib/newrelic_rpm_rb.html +147 -0
  204. data/rdoc/files/lib/tasks/all_rb.html +107 -0
  205. data/rdoc/fr_class_index.html +134 -0
  206. data/rdoc/fr_file_index.html +103 -0
  207. data/rdoc/fr_method_index.html +568 -0
  208. data/rdoc/index.html +24 -0
  209. data/rdoc/rdoc-style.css +208 -0
  210. data/test/new_relic/agent/active_record_instrumentation_test.rb +16 -5
  211. data/test/new_relic/agent/collection_helper_test.rb +1 -1
  212. data/test/new_relic/agent/error_collector_test.rb +2 -4
  213. data/test/new_relic/agent/rpm_agent_test.rb +1 -1
  214. data/test/new_relic/agent/task_instrumentation_test.rb +1 -1
  215. data/test/new_relic/agent/worker_loop_test.rb +33 -76
  216. data/test/new_relic/control_test.rb +9 -2
  217. data/test/new_relic/stats_test.rb +29 -1
  218. data/test/new_relic/version_number_test.rb +13 -0
  219. data/ui/helpers/newrelic_helper.rb +1 -2
  220. metadata +196 -4
@@ -0,0 +1,148 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: NewRelic::Control::External</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">NewRelic::Control::External</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/new_relic/control/external_rb.html">
59
+ lib/new_relic/control/external.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Ruby.html">
69
+ NewRelic::Control::Ruby
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+
84
+
85
+ </div>
86
+
87
+ <div id="method-list">
88
+ <h3 class="section-bar">Methods</h3>
89
+
90
+ <div class="name-list">
91
+ <a href="#M000317">init_config</a>&nbsp;&nbsp;
92
+ </div>
93
+ </div>
94
+
95
+ </div>
96
+
97
+
98
+ <!-- if includes -->
99
+
100
+ <div id="section">
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ <!-- if method_list -->
110
+ <div id="methods">
111
+ <h3 class="section-bar">Public Instance methods</h3>
112
+
113
+ <div id="method-M000317" class="method-detail">
114
+ <a name="M000317"></a>
115
+
116
+ <div class="method-heading">
117
+ <a href="#M000317" class="method-signature">
118
+ <span class="method-name">init_config</span><span class="method-args">(options={})</span>
119
+ </a>
120
+ </div>
121
+
122
+ <div class="method-description">
123
+ <p><a class="source-toggle" href="#"
124
+ onclick="toggleCode('M000317-source');return false;">[Source]</a></p>
125
+ <div class="method-source-code" id="M000317-source">
126
+ <pre>
127
+ <span class="ruby-comment cmt"># File lib/new_relic/control/external.rb, line 9</span>
128
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_config</span>(<span class="ruby-identifier">options</span>={})
129
+ <span class="ruby-keyword kw">super</span>
130
+ <span class="ruby-keyword kw">end</span>
131
+ </pre>
132
+ </div>
133
+ </div>
134
+ </div>
135
+
136
+
137
+ </div>
138
+
139
+
140
+ </div>
141
+
142
+
143
+ <div id="validator-badges">
144
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
145
+ </div>
146
+
147
+ </body>
148
+ </html>
@@ -0,0 +1,227 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: NewRelic::Control::Merb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">NewRelic::Control::Merb</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/new_relic/control/merb_rb.html">
59
+ lib/new_relic/control/merb.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="../Control.html">
69
+ NewRelic::Control
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+
84
+
85
+ </div>
86
+
87
+ <div id="method-list">
88
+ <h3 class="section-bar">Methods</h3>
89
+
90
+ <div class="name-list">
91
+ <a href="#M000337">env</a>&nbsp;&nbsp;
92
+ <a href="#M000340">init_config</a>&nbsp;&nbsp;
93
+ <a href="#M000338">root</a>&nbsp;&nbsp;
94
+ <a href="#M000339">to_stdout</a>&nbsp;&nbsp;
95
+ </div>
96
+ </div>
97
+
98
+ </div>
99
+
100
+
101
+ <!-- if includes -->
102
+
103
+ <div id="section">
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ <!-- if method_list -->
113
+ <div id="methods">
114
+ <h3 class="section-bar">Public Instance methods</h3>
115
+
116
+ <div id="method-M000337" class="method-detail">
117
+ <a name="M000337"></a>
118
+
119
+ <div class="method-heading">
120
+ <a href="#M000337" class="method-signature">
121
+ <span class="method-name">env</span><span class="method-args">()</span>
122
+ </a>
123
+ </div>
124
+
125
+ <div class="method-description">
126
+ <p><a class="source-toggle" href="#"
127
+ onclick="toggleCode('M000337-source');return false;">[Source]</a></p>
128
+ <div class="method-source-code" id="M000337-source">
129
+ <pre>
130
+ <span class="ruby-comment cmt"># File lib/new_relic/control/merb.rb, line 3</span>
131
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">env</span>
132
+ <span class="ruby-ivar">@env</span> <span class="ruby-operator">||=</span> <span class="ruby-operator">::</span><span class="ruby-constant">Merb</span>.<span class="ruby-identifier">env</span>
133
+ <span class="ruby-keyword kw">end</span>
134
+ </pre>
135
+ </div>
136
+ </div>
137
+ </div>
138
+
139
+ <div id="method-M000340" class="method-detail">
140
+ <a name="M000340"></a>
141
+
142
+ <div class="method-heading">
143
+ <a href="#M000340" class="method-signature">
144
+ <span class="method-name">init_config</span><span class="method-args">(options={})</span>
145
+ </a>
146
+ </div>
147
+
148
+ <div class="method-description">
149
+ <p><a class="source-toggle" href="#"
150
+ onclick="toggleCode('M000340-source');return false;">[Source]</a></p>
151
+ <div class="method-source-code" id="M000340-source">
152
+ <pre>
153
+ <span class="ruby-comment cmt"># File lib/new_relic/control/merb.rb, line 16</span>
154
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_config</span> <span class="ruby-identifier">options</span>={}
155
+ <span class="ruby-operator">::</span><span class="ruby-constant">Merb</span><span class="ruby-operator">::</span><span class="ruby-constant">Plugins</span>.<span class="ruby-identifier">add_rakefiles</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">newrelic_root</span>,<span class="ruby-value str">&quot;lib/tasks/all.rb&quot;</span>)
156
+
157
+ <span class="ruby-comment cmt"># Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it</span>
158
+ <span class="ruby-operator">::</span><span class="ruby-constant">Merb</span><span class="ruby-operator">::</span><span class="ruby-constant">Plugins</span>.<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:newrelic</span>] = {
159
+ <span class="ruby-identifier">:config</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>
160
+ }
161
+ <span class="ruby-keyword kw">end</span>
162
+ </pre>
163
+ </div>
164
+ </div>
165
+ </div>
166
+
167
+ <div id="method-M000338" class="method-detail">
168
+ <a name="M000338"></a>
169
+
170
+ <div class="method-heading">
171
+ <a href="#M000338" class="method-signature">
172
+ <span class="method-name">root</span><span class="method-args">()</span>
173
+ </a>
174
+ </div>
175
+
176
+ <div class="method-description">
177
+ <p><a class="source-toggle" href="#"
178
+ onclick="toggleCode('M000338-source');return false;">[Source]</a></p>
179
+ <div class="method-source-code" id="M000338-source">
180
+ <pre>
181
+ <span class="ruby-comment cmt"># File lib/new_relic/control/merb.rb, line 6</span>
182
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">root</span>
183
+ <span class="ruby-operator">::</span><span class="ruby-constant">Merb</span>.<span class="ruby-identifier">root</span>
184
+ <span class="ruby-keyword kw">end</span>
185
+ </pre>
186
+ </div>
187
+ </div>
188
+ </div>
189
+
190
+ <div id="method-M000339" class="method-detail">
191
+ <a name="M000339"></a>
192
+
193
+ <div class="method-heading">
194
+ <a href="#M000339" class="method-signature">
195
+ <span class="method-name">to_stdout</span><span class="method-args">(msg)</span>
196
+ </a>
197
+ </div>
198
+
199
+ <div class="method-description">
200
+ <p><a class="source-toggle" href="#"
201
+ onclick="toggleCode('M000339-source');return false;">[Source]</a></p>
202
+ <div class="method-source-code" id="M000339-source">
203
+ <pre>
204
+ <span class="ruby-comment cmt"># File lib/new_relic/control/merb.rb, line 10</span>
205
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_stdout</span>(<span class="ruby-identifier">msg</span>)
206
+ <span class="ruby-constant">Merb</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">&quot;NewRelic ~ &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>)
207
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
208
+ <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;NewRelic ~ &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>
209
+ <span class="ruby-keyword kw">end</span>
210
+ </pre>
211
+ </div>
212
+ </div>
213
+ </div>
214
+
215
+
216
+ </div>
217
+
218
+
219
+ </div>
220
+
221
+
222
+ <div id="validator-badges">
223
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
224
+ </div>
225
+
226
+ </body>
227
+ </html>
@@ -0,0 +1,542 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: NewRelic::Control::Rails</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">NewRelic::Control::Rails</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/new_relic/control/rails_rb.html">
59
+ lib/new_relic/control/rails.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="../Control.html">
69
+ NewRelic::Control
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ <a href="../Control.html">Control</a> subclass instantiated when <a
86
+ href="Rails.html">Rails</a> is detected. Contains <a
87
+ href="Rails.html">Rails</a> specific configuration, instrumentation,
88
+ environment values, etc.
89
+ </p>
90
+
91
+ </div>
92
+
93
+
94
+ </div>
95
+
96
+ <div id="method-list">
97
+ <h3 class="section-bar">Methods</h3>
98
+
99
+ <div class="name-list">
100
+ <a href="#M000328">append_environment_info</a>&nbsp;&nbsp;
101
+ <a href="#M000326">draw_with_newrelic_map</a>&nbsp;&nbsp;
102
+ <a href="#M000318">env</a>&nbsp;&nbsp;
103
+ <a href="#M000321">init_config</a>&nbsp;&nbsp;
104
+ <a href="#M000322">install_developer_mode</a>&nbsp;&nbsp;
105
+ <a href="#M000325">install_devmode_route</a>&nbsp;&nbsp;
106
+ <a href="#M000329">install_shim</a>&nbsp;&nbsp;
107
+ <a href="#M000320">log_path</a>&nbsp;&nbsp;
108
+ <a href="#M000327">rails_vendor_root</a>&nbsp;&nbsp;
109
+ <a href="#M000324">rails_version</a>&nbsp;&nbsp;
110
+ <a href="#M000319">root</a>&nbsp;&nbsp;
111
+ <a href="#M000323">to_stdout</a>&nbsp;&nbsp;
112
+ </div>
113
+ </div>
114
+
115
+ </div>
116
+
117
+
118
+ <!-- if includes -->
119
+
120
+ <div id="section">
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <!-- if method_list -->
130
+ <div id="methods">
131
+ <h3 class="section-bar">Public Instance methods</h3>
132
+
133
+ <div id="method-M000318" class="method-detail">
134
+ <a name="M000318"></a>
135
+
136
+ <div class="method-heading">
137
+ <a href="#M000318" class="method-signature">
138
+ <span class="method-name">env</span><span class="method-args">()</span>
139
+ </a>
140
+ </div>
141
+
142
+ <div class="method-description">
143
+ <p><a class="source-toggle" href="#"
144
+ onclick="toggleCode('M000318-source');return false;">[Source]</a></p>
145
+ <div class="method-source-code" id="M000318-source">
146
+ <pre>
147
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 6</span>
148
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">env</span>
149
+ <span class="ruby-ivar">@env</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">RAILS_ENV</span>.<span class="ruby-identifier">dup</span>
150
+ <span class="ruby-keyword kw">end</span>
151
+ </pre>
152
+ </div>
153
+ </div>
154
+ </div>
155
+
156
+ <div id="method-M000321" class="method-detail">
157
+ <a name="M000321"></a>
158
+
159
+ <div class="method-heading">
160
+ <a href="#M000321" class="method-signature">
161
+ <span class="method-name">init_config</span><span class="method-args">(options={})</span>
162
+ </a>
163
+ </div>
164
+
165
+ <div class="method-description">
166
+ <p>
167
+ In versions of <a href="Rails.html">Rails</a> prior to 2.0, the rails
168
+ config was only available to the init.rb, so it had to be passed on from
169
+ there.
170
+ </p>
171
+ <p><a class="source-toggle" href="#"
172
+ onclick="toggleCode('M000321-source');return false;">[Source]</a></p>
173
+ <div class="method-source-code" id="M000321-source">
174
+ <pre>
175
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 21</span>
176
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_config</span>(<span class="ruby-identifier">options</span>={})
177
+ <span class="ruby-identifier">rails_config</span>=<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:config</span>]
178
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">agent_enabled?</span>
179
+ <span class="ruby-comment cmt"># Might not be running if it does not think mongrel, thin, passenger, etc</span>
180
+ <span class="ruby-comment cmt"># is running, if it things it's a rake task, or if the agent_enabled is false.</span>
181
+ <span class="ruby-operator">::</span><span class="ruby-constant">RAILS_DEFAULT_LOGGER</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;New Relic Agent not running.&quot;</span>
182
+ <span class="ruby-keyword kw">else</span>
183
+ <span class="ruby-operator">::</span><span class="ruby-constant">RAILS_DEFAULT_LOGGER</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;Starting the New Relic Agent.&quot;</span>
184
+ <span class="ruby-identifier">install_developer_mode</span> <span class="ruby-identifier">rails_config</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">developer_mode?</span>
185
+ <span class="ruby-keyword kw">end</span>
186
+ <span class="ruby-keyword kw">end</span>
187
+ </pre>
188
+ </div>
189
+ </div>
190
+ </div>
191
+
192
+ <div id="method-M000322" class="method-detail">
193
+ <a name="M000322"></a>
194
+
195
+ <div class="method-heading">
196
+ <a href="#M000322" class="method-signature">
197
+ <span class="method-name">install_developer_mode</span><span class="method-args">(rails_config)</span>
198
+ </a>
199
+ </div>
200
+
201
+ <div class="method-description">
202
+ <p><a class="source-toggle" href="#"
203
+ onclick="toggleCode('M000322-source');return false;">[Source]</a></p>
204
+ <div class="method-source-code" id="M000322-source">
205
+ <pre>
206
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 33</span>
207
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install_developer_mode</span>(<span class="ruby-identifier">rails_config</span>)
208
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@installed</span>
209
+ <span class="ruby-ivar">@installed</span> = <span class="ruby-keyword kw">true</span>
210
+ <span class="ruby-identifier">controller_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">newrelic_root</span>, <span class="ruby-value str">'ui'</span>, <span class="ruby-value str">'controllers'</span>))
211
+ <span class="ruby-identifier">helper_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">newrelic_root</span>, <span class="ruby-value str">'ui'</span>, <span class="ruby-value str">'helpers'</span>))
212
+
213
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependencies</span>
214
+ <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{helper_path}/*.rb&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">require</span> <span class="ruby-identifier">f</span> }
215
+ <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{controller_path}/*.rb&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">require</span> <span class="ruby-identifier">f</span> }
216
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">defined?</span> <span class="ruby-constant">Dependencies</span>.<span class="ruby-identifier">load_paths</span>
217
+ <span class="ruby-constant">Dependencies</span>.<span class="ruby-identifier">load_paths</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">controller_path</span>
218
+ <span class="ruby-constant">Dependencies</span>.<span class="ruby-identifier">load_paths</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">helper_path</span>
219
+ <span class="ruby-keyword kw">else</span>
220
+ <span class="ruby-identifier">to_stdout</span> <span class="ruby-node">&quot;ERROR: Rails version #{::Rails::VERSION::STRING} too old for developer mode to work.&quot;</span>
221
+ <span class="ruby-keyword kw">return</span>
222
+ <span class="ruby-keyword kw">end</span>
223
+ <span class="ruby-identifier">install_devmode_route</span>
224
+
225
+ <span class="ruby-comment cmt"># If we have the config object then add the controller path to the list.</span>
226
+ <span class="ruby-comment cmt"># Otherwise we have to assume the controller paths have already been</span>
227
+ <span class="ruby-comment cmt"># set and we can just append newrelic.</span>
228
+
229
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rails_config</span>
230
+ <span class="ruby-identifier">rails_config</span>.<span class="ruby-identifier">controller_paths</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">controller_path</span>
231
+ <span class="ruby-keyword kw">else</span>
232
+ <span class="ruby-identifier">current_paths</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">controller_paths</span>
233
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current_paths</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">current_paths</span>.<span class="ruby-identifier">empty?</span>
234
+ <span class="ruby-identifier">to_stdout</span> <span class="ruby-value str">&quot;WARNING: Unable to modify the routes in this version of Rails. Developer mode not available.&quot;</span>
235
+ <span class="ruby-keyword kw">end</span>
236
+ <span class="ruby-identifier">current_paths</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">controller_path</span>
237
+ <span class="ruby-keyword kw">end</span>
238
+
239
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_stdout</span>(<span class="ruby-identifier">message</span>)
240
+ <span class="ruby-operator">::</span><span class="ruby-constant">RAILS_DEFAULT_LOGGER</span>.<span class="ruby-identifier">info</span>(<span class="ruby-identifier">message</span>)
241
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
242
+ <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">message</span>)
243
+ <span class="ruby-keyword kw">end</span>
244
+
245
+ <span class="ruby-comment cmt">#ActionController::Routing::Routes.reload! unless NewRelic::Control.instance['skip_developer_route']</span>
246
+
247
+ <span class="ruby-comment cmt"># inform user that the dev edition is available if we are running inside</span>
248
+ <span class="ruby-comment cmt"># a webserver process</span>
249
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@local_env</span>.<span class="ruby-identifier">dispatcher_instance_id</span>
250
+ <span class="ruby-identifier">port</span> = <span class="ruby-ivar">@local_env</span>.<span class="ruby-identifier">dispatcher_instance_id</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+/</span> <span class="ruby-operator">?</span> <span class="ruby-node">&quot;:#{local_env.dispatcher_instance_id}&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;:port&quot;</span>
251
+ <span class="ruby-identifier">to_stdout</span> <span class="ruby-value str">&quot;NewRelic Agent Developer Mode enabled.&quot;</span>
252
+ <span class="ruby-identifier">to_stdout</span> <span class="ruby-node">&quot;To view performance information, go to http://localhost#{port}/newrelic&quot;</span>
253
+ <span class="ruby-keyword kw">end</span>
254
+ <span class="ruby-keyword kw">end</span>
255
+ </pre>
256
+ </div>
257
+ </div>
258
+ </div>
259
+
260
+ <div id="method-M000320" class="method-detail">
261
+ <a name="M000320"></a>
262
+
263
+ <div class="method-heading">
264
+ <a href="#M000320" class="method-signature">
265
+ <span class="method-name">log_path</span><span class="method-args">()</span>
266
+ </a>
267
+ </div>
268
+
269
+ <div class="method-description">
270
+ <p><a class="source-toggle" href="#"
271
+ onclick="toggleCode('M000320-source');return false;">[Source]</a></p>
272
+ <div class="method-source-code" id="M000320-source">
273
+ <pre>
274
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 13</span>
275
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_path</span>
276
+ <span class="ruby-identifier">path</span> = <span class="ruby-operator">::</span><span class="ruby-constant">RAILS_DEFAULT_LOGGER</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-keyword kw">do</span>
277
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-ivar">@log</span>.<span class="ruby-identifier">path</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-ivar">@logdev</span>.<span class="ruby-identifier">filename</span>)
278
+ <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-node">&quot;#{root}/log&quot;</span>
279
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
280
+ <span class="ruby-keyword kw">end</span>
281
+ </pre>
282
+ </div>
283
+ </div>
284
+ </div>
285
+
286
+ <div id="method-M000324" class="method-detail">
287
+ <a name="M000324"></a>
288
+
289
+ <div class="method-heading">
290
+ <a href="#M000324" class="method-signature">
291
+ <span class="method-name">rails_version</span><span class="method-args">()</span>
292
+ </a>
293
+ </div>
294
+
295
+ <div class="method-description">
296
+ <p><a class="source-toggle" href="#"
297
+ onclick="toggleCode('M000324-source');return false;">[Source]</a></p>
298
+ <div class="method-source-code" id="M000324-source">
299
+ <pre>
300
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 82</span>
301
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rails_version</span>
302
+ <span class="ruby-ivar">@rails_version</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">VersionNumber</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">::</span><span class="ruby-constant">Rails</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span><span class="ruby-operator">::</span><span class="ruby-constant">STRING</span>)
303
+ <span class="ruby-keyword kw">end</span>
304
+ </pre>
305
+ </div>
306
+ </div>
307
+ </div>
308
+
309
+ <div id="method-M000319" class="method-detail">
310
+ <a name="M000319"></a>
311
+
312
+ <div class="method-heading">
313
+ <a href="#M000319" class="method-signature">
314
+ <span class="method-name">root</span><span class="method-args">()</span>
315
+ </a>
316
+ </div>
317
+
318
+ <div class="method-description">
319
+ <p><a class="source-toggle" href="#"
320
+ onclick="toggleCode('M000319-source');return false;">[Source]</a></p>
321
+ <div class="method-source-code" id="M000319-source">
322
+ <pre>
323
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 9</span>
324
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">root</span>
325
+ <span class="ruby-constant">RAILS_ROOT</span>
326
+ <span class="ruby-keyword kw">end</span>
327
+ </pre>
328
+ </div>
329
+ </div>
330
+ </div>
331
+
332
+ <div id="method-M000323" class="method-detail">
333
+ <a name="M000323"></a>
334
+
335
+ <div class="method-heading">
336
+ <a href="#M000323" class="method-signature">
337
+ <span class="method-name">to_stdout</span><span class="method-args">(message)</span>
338
+ </a>
339
+ </div>
340
+
341
+ <div class="method-description">
342
+ <p><a class="source-toggle" href="#"
343
+ onclick="toggleCode('M000323-source');return false;">[Source]</a></p>
344
+ <div class="method-source-code" id="M000323-source">
345
+ <pre>
346
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 65</span>
347
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_stdout</span>(<span class="ruby-identifier">message</span>)
348
+ <span class="ruby-operator">::</span><span class="ruby-constant">RAILS_DEFAULT_LOGGER</span>.<span class="ruby-identifier">info</span>(<span class="ruby-identifier">message</span>)
349
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
350
+ <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">message</span>)
351
+ <span class="ruby-keyword kw">end</span>
352
+ </pre>
353
+ </div>
354
+ </div>
355
+ </div>
356
+
357
+ <h3 class="section-bar">Protected Instance methods</h3>
358
+
359
+ <div id="method-M000328" class="method-detail">
360
+ <a name="M000328"></a>
361
+
362
+ <div class="method-heading">
363
+ <a href="#M000328" class="method-signature">
364
+ <span class="method-name">append_environment_info</span><span class="method-args">()</span>
365
+ </a>
366
+ </div>
367
+
368
+ <div class="method-description">
369
+ <p>
370
+ Collect the Rails::Info into an associative array as well as the list of
371
+ plugins
372
+ </p>
373
+ <p><a class="source-toggle" href="#"
374
+ onclick="toggleCode('M000328-source');return false;">[Source]</a></p>
375
+ <div class="method-source-code" id="M000328-source">
376
+ <pre>
377
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 113</span>
378
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">append_environment_info</span>
379
+ <span class="ruby-identifier">local_env</span>.<span class="ruby-identifier">append_environment_value</span>(<span class="ruby-value str">'Rails version'</span>){ <span class="ruby-operator">::</span><span class="ruby-constant">Rails</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span><span class="ruby-operator">::</span><span class="ruby-constant">STRING</span> }
380
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rails_version</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">VersionNumber</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'2.2.0'</span>)
381
+ <span class="ruby-identifier">local_env</span>.<span class="ruby-identifier">append_environment_value</span>(<span class="ruby-value str">'Rails threadsafe'</span>) <span class="ruby-keyword kw">do</span>
382
+ <span class="ruby-operator">::</span><span class="ruby-constant">Rails</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">action_controller</span>.<span class="ruby-identifier">allow_concurrency</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span>
383
+ <span class="ruby-keyword kw">end</span>
384
+ <span class="ruby-keyword kw">end</span>
385
+ <span class="ruby-identifier">local_env</span>.<span class="ruby-identifier">append_environment_value</span>(<span class="ruby-value str">'Rails Env'</span>) { <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'RAILS_ENV'</span>] }
386
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rails_version</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">VersionNumber</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'2.1.0'</span>)
387
+ <span class="ruby-identifier">local_env</span>.<span class="ruby-identifier">append_gem_list</span> <span class="ruby-keyword kw">do</span>
388
+ <span class="ruby-operator">::</span><span class="ruby-constant">Rails</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">gems</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">gem</span> <span class="ruby-operator">|</span>
389
+ <span class="ruby-identifier">version</span> = (<span class="ruby-identifier">gem</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:version</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">gem</span>.<span class="ruby-identifier">version</span>) <span class="ruby-operator">||</span>
390
+ (<span class="ruby-identifier">gem</span>.<span class="ruby-identifier">specification</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:version</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">gem</span>.<span class="ruby-identifier">specification</span>.<span class="ruby-identifier">version</span>)
391
+ <span class="ruby-identifier">gem</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">version</span> <span class="ruby-value">? </span><span class="ruby-node">&quot;(#{version})&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;&quot;</span>)
392
+ <span class="ruby-keyword kw">end</span>
393
+ <span class="ruby-keyword kw">end</span>
394
+ <span class="ruby-comment cmt"># The plugins is configured manually. If it's nil, it loads everything non-deterministically</span>
395
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">::</span><span class="ruby-constant">Rails</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">plugins</span>
396
+ <span class="ruby-identifier">local_env</span>.<span class="ruby-identifier">append_plugin_list</span> { <span class="ruby-operator">::</span><span class="ruby-constant">Rails</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">plugins</span> }
397
+ <span class="ruby-keyword kw">else</span>
398
+ <span class="ruby-operator">::</span><span class="ruby-constant">Rails</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">plugin_paths</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
399
+ <span class="ruby-identifier">local_env</span>.<span class="ruby-identifier">append_plugin_list</span> { <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value str">'*'</span>)].<span class="ruby-identifier">collect</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span> <span class="ruby-identifier">p</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">p</span> }.<span class="ruby-identifier">compact</span> }
400
+ <span class="ruby-keyword kw">end</span>
401
+ <span class="ruby-keyword kw">end</span>
402
+ <span class="ruby-keyword kw">else</span>
403
+ <span class="ruby-comment cmt"># Rails prior to 2.1, can't get the gems. Find plugins in the default location</span>
404
+ <span class="ruby-identifier">local_env</span>.<span class="ruby-identifier">append_plugin_list</span> <span class="ruby-keyword kw">do</span>
405
+ <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">root</span>, <span class="ruby-value str">'vendor'</span>, <span class="ruby-value str">'plugins'</span>, <span class="ruby-value str">'*'</span>)].<span class="ruby-identifier">collect</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span> <span class="ruby-identifier">p</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">p</span> }.<span class="ruby-identifier">compact</span>
406
+ <span class="ruby-keyword kw">end</span>
407
+ <span class="ruby-keyword kw">end</span>
408
+ <span class="ruby-keyword kw">end</span>
409
+ </pre>
410
+ </div>
411
+ </div>
412
+ </div>
413
+
414
+ <div id="method-M000326" class="method-detail">
415
+ <a name="M000326"></a>
416
+
417
+ <div class="method-heading">
418
+ <a href="#M000326" class="method-signature">
419
+ <span class="method-name">draw_with_newrelic_map</span><span class="method-args">() {|map| ...}</span>
420
+ </a>
421
+ </div>
422
+
423
+ <div class="method-description">
424
+ <p><a class="source-toggle" href="#"
425
+ onclick="toggleCode('M000326-source');return false;">[Source]</a></p>
426
+ <div class="method-source-code" id="M000326-source">
427
+ <pre>
428
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 95</span>
429
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_with_newrelic_map</span>
430
+ <span class="ruby-identifier">draw_without_newrelic_map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">map</span> <span class="ruby-operator">|</span>
431
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Control</span>.<span class="ruby-identifier">instance</span>[<span class="ruby-value str">'skip_developer_route'</span>]
432
+ <span class="ruby-identifier">map</span>.<span class="ruby-identifier">named_route</span> <span class="ruby-value str">'newrelic_developer'</span>, <span class="ruby-value str">'/newrelic/:action/:id'</span>, <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'newrelic'</span>
433
+ <span class="ruby-identifier">map</span>.<span class="ruby-identifier">named_route</span> <span class="ruby-value str">'newrelic_file'</span>, <span class="ruby-value str">'/newrelic/file/*file'</span>, <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'newrelic'</span>, <span class="ruby-identifier">:action=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'file'</span>
434
+ <span class="ruby-keyword kw">end</span>
435
+ <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">map</span>
436
+ <span class="ruby-keyword kw">end</span>
437
+ <span class="ruby-keyword kw">end</span>
438
+ </pre>
439
+ </div>
440
+ </div>
441
+ </div>
442
+
443
+ <div id="method-M000325" class="method-detail">
444
+ <a name="M000325"></a>
445
+
446
+ <div class="method-heading">
447
+ <a href="#M000325" class="method-signature">
448
+ <span class="method-name">install_devmode_route</span><span class="method-args">()</span>
449
+ </a>
450
+ </div>
451
+
452
+ <div class="method-description">
453
+ <p><a class="source-toggle" href="#"
454
+ onclick="toggleCode('M000325-source');return false;">[Source]</a></p>
455
+ <div class="method-source-code" id="M000325-source">
456
+ <pre>
457
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 88</span>
458
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install_devmode_route</span>
459
+ <span class="ruby-comment cmt"># This is a monkey patch to inject the developer tool route into the</span>
460
+ <span class="ruby-comment cmt"># parent app without requiring users to modify their routes. Of course this </span>
461
+ <span class="ruby-comment cmt"># has the effect of adding a route indiscriminately which is frowned upon by </span>
462
+ <span class="ruby-comment cmt"># some: http://www.ruby-forum.com/topic/126316#563328</span>
463
+ <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">RouteSet</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
464
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-value str">'draw_with_newrelic_map'</span>
465
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw_with_newrelic_map</span>
466
+ <span class="ruby-identifier">draw_without_newrelic_map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">map</span> <span class="ruby-operator">|</span>
467
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Control</span>.<span class="ruby-identifier">instance</span>[<span class="ruby-value str">'skip_developer_route'</span>]
468
+ <span class="ruby-identifier">map</span>.<span class="ruby-identifier">named_route</span> <span class="ruby-value str">'newrelic_developer'</span>, <span class="ruby-value str">'/newrelic/:action/:id'</span>, <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'newrelic'</span>
469
+ <span class="ruby-identifier">map</span>.<span class="ruby-identifier">named_route</span> <span class="ruby-value str">'newrelic_file'</span>, <span class="ruby-value str">'/newrelic/file/*file'</span>, <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'newrelic'</span>, <span class="ruby-identifier">:action=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'file'</span>
470
+ <span class="ruby-keyword kw">end</span>
471
+ <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">map</span>
472
+ <span class="ruby-keyword kw">end</span>
473
+ <span class="ruby-keyword kw">end</span>
474
+ <span class="ruby-identifier">alias_method_chain</span> <span class="ruby-identifier">:draw</span>, <span class="ruby-identifier">:newrelic_map</span>
475
+ <span class="ruby-keyword kw">end</span>
476
+ <span class="ruby-keyword kw">end</span>
477
+ </pre>
478
+ </div>
479
+ </div>
480
+ </div>
481
+
482
+ <div id="method-M000329" class="method-detail">
483
+ <a name="M000329"></a>
484
+
485
+ <div class="method-heading">
486
+ <a href="#M000329" class="method-signature">
487
+ <span class="method-name">install_shim</span><span class="method-args">()</span>
488
+ </a>
489
+ </div>
490
+
491
+ <div class="method-description">
492
+ <p><a class="source-toggle" href="#"
493
+ onclick="toggleCode('M000329-source');return false;">[Source]</a></p>
494
+ <div class="method-source-code" id="M000329-source">
495
+ <pre>
496
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 145</span>
497
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install_shim</span>
498
+ <span class="ruby-keyword kw">super</span>
499
+ <span class="ruby-identifier">require</span> <span class="ruby-value str">'new_relic/agent/instrumentation/controller_instrumentation'</span>
500
+ <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:include</span>, <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span><span class="ruby-operator">::</span><span class="ruby-constant">Instrumentation</span><span class="ruby-operator">::</span><span class="ruby-constant">ControllerInstrumentation</span><span class="ruby-operator">::</span><span class="ruby-constant">Shim</span>
501
+ <span class="ruby-keyword kw">end</span>
502
+ </pre>
503
+ </div>
504
+ </div>
505
+ </div>
506
+
507
+ <div id="method-M000327" class="method-detail">
508
+ <a name="M000327"></a>
509
+
510
+ <div class="method-heading">
511
+ <a href="#M000327" class="method-signature">
512
+ <span class="method-name">rails_vendor_root</span><span class="method-args">()</span>
513
+ </a>
514
+ </div>
515
+
516
+ <div class="method-description">
517
+ <p><a class="source-toggle" href="#"
518
+ onclick="toggleCode('M000327-source');return false;">[Source]</a></p>
519
+ <div class="method-source-code" id="M000327-source">
520
+ <pre>
521
+ <span class="ruby-comment cmt"># File lib/new_relic/control/rails.rb, line 108</span>
522
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rails_vendor_root</span>
523
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">root</span>,<span class="ruby-value str">'vendor'</span>,<span class="ruby-value str">'rails'</span>)
524
+ <span class="ruby-keyword kw">end</span>
525
+ </pre>
526
+ </div>
527
+ </div>
528
+ </div>
529
+
530
+
531
+ </div>
532
+
533
+
534
+ </div>
535
+
536
+
537
+ <div id="validator-badges">
538
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
539
+ </div>
540
+
541
+ </body>
542
+ </html>