newrelic_rpm 2.10.8 → 2.11.0.beta

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 (212) hide show
  1. data/CHANGELOG +15 -3
  2. data/lib/new_relic/agent.rb +17 -6
  3. data/lib/new_relic/agent/agent.rb +98 -77
  4. data/lib/new_relic/agent/busy_calculator.rb +1 -1
  5. data/lib/new_relic/agent/error_collector.rb +6 -3
  6. data/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb +1 -0
  7. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +0 -2
  8. data/lib/new_relic/agent/instrumentation/memcache.rb +0 -1
  9. data/lib/new_relic/agent/instrumentation/metric_frame.rb +8 -2
  10. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +3 -3
  11. data/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb +10 -0
  12. data/lib/new_relic/agent/method_tracer.rb +1 -1
  13. data/lib/new_relic/agent/shim_agent.rb +1 -1
  14. data/lib/new_relic/agent/stats_engine.rb +1 -1
  15. data/lib/new_relic/agent/stats_engine/samplers.rb +2 -2
  16. data/lib/new_relic/control.rb +6 -3
  17. data/lib/new_relic/rack/metric_app.rb +4 -4
  18. data/lib/new_relic/version.rb +3 -3
  19. data/newrelic.yml +3 -3
  20. data/newrelic_rpm.gemspec +4 -192
  21. data/test/new_relic/agent/rpm_agent_test.rb +15 -2
  22. data/test/new_relic/agent/task_instrumentation_test.rb +3 -2
  23. metadata +12 -197
  24. data/rdoc/classes/NewRelic.html +0 -293
  25. data/rdoc/classes/NewRelic/Agent.html +0 -810
  26. data/rdoc/classes/NewRelic/Agent/Agent.html +0 -742
  27. data/rdoc/classes/NewRelic/Agent/BackgroundLoadingError.html +0 -111
  28. data/rdoc/classes/NewRelic/Agent/BusyCalculator.html +0 -309
  29. data/rdoc/classes/NewRelic/Agent/CollectionHelper.html +0 -196
  30. data/rdoc/classes/NewRelic/Agent/ErrorCollector.html +0 -378
  31. data/rdoc/classes/NewRelic/Agent/ForceDisconnectException.html +0 -118
  32. data/rdoc/classes/NewRelic/Agent/ForceRestartException.html +0 -117
  33. data/rdoc/classes/NewRelic/Agent/IgnoreSilentlyException.html +0 -118
  34. data/rdoc/classes/NewRelic/Agent/Instrumentation.html +0 -174
  35. data/rdoc/classes/NewRelic/Agent/Instrumentation/ActiveRecordInstrumentation.html +0 -221
  36. data/rdoc/classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation.html +0 -349
  37. data/rdoc/classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation/ClassMethods.html +0 -277
  38. data/rdoc/classes/NewRelic/Agent/Instrumentation/DelayedJobInstrumentation.html +0 -112
  39. data/rdoc/classes/NewRelic/Agent/Instrumentation/MetricFrame.html +0 -1007
  40. data/rdoc/classes/NewRelic/Agent/Instrumentation/Rack.html +0 -321
  41. data/rdoc/classes/NewRelic/Agent/Instrumentation/Sinatra.html +0 -176
  42. data/rdoc/classes/NewRelic/Agent/LicenseException.html +0 -117
  43. data/rdoc/classes/NewRelic/Agent/MethodTracer.html +0 -150
  44. data/rdoc/classes/NewRelic/Agent/MethodTracer/ClassMethods.html +0 -295
  45. data/rdoc/classes/NewRelic/Agent/MethodTracer/InstanceMethods.html +0 -284
  46. data/rdoc/classes/NewRelic/Agent/PostTooBigException.html +0 -120
  47. data/rdoc/classes/NewRelic/Agent/Sampler.html +0 -314
  48. data/rdoc/classes/NewRelic/Agent/Sampler/Unsupported.html +0 -117
  49. data/rdoc/classes/NewRelic/Agent/Samplers.html +0 -126
  50. data/rdoc/classes/NewRelic/Agent/Samplers/CpuSampler.html +0 -327
  51. data/rdoc/classes/NewRelic/Agent/Samplers/DelayedJobLockSampler.html +0 -296
  52. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler.html +0 -321
  53. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/Base.html +0 -186
  54. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/JavaHeapSampler.html +0 -173
  55. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/ProcStatus.html +0 -216
  56. data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/ShellPS.html +0 -207
  57. data/rdoc/classes/NewRelic/Agent/Samplers/ObjectSampler.html +0 -222
  58. data/rdoc/classes/NewRelic/Agent/ServerError.html +0 -117
  59. data/rdoc/classes/NewRelic/Agent/ShimAgent.html +0 -297
  60. data/rdoc/classes/NewRelic/Agent/StatsEngine.html +0 -204
  61. data/rdoc/classes/NewRelic/Agent/StatsEngine/MetricStats.html +0 -441
  62. data/rdoc/classes/NewRelic/Agent/StatsEngine/Samplers.html +0 -237
  63. data/rdoc/classes/NewRelic/Agent/StatsEngine/ScopeStackElement.html +0 -178
  64. data/rdoc/classes/NewRelic/Agent/StatsEngine/Transactions.html +0 -385
  65. data/rdoc/classes/NewRelic/Agent/TransactionSampleBuilder.html +0 -505
  66. data/rdoc/classes/NewRelic/Agent/TransactionSampler.html +0 -690
  67. data/rdoc/classes/NewRelic/Agent/WorkerLoop.html +0 -305
  68. data/rdoc/classes/NewRelic/Agent/WorkerLoop/LoopTask.html +0 -224
  69. data/rdoc/classes/NewRelic/ApdexStats.html +0 -196
  70. data/rdoc/classes/NewRelic/BasicStats.html +0 -113
  71. data/rdoc/classes/NewRelic/ChainedCall.html +0 -180
  72. data/rdoc/classes/NewRelic/Commands.html +0 -112
  73. data/rdoc/classes/NewRelic/Commands/CommandFailure.html +0 -167
  74. data/rdoc/classes/NewRelic/Commands/Deployments.html +0 -285
  75. data/rdoc/classes/NewRelic/Control.html +0 -1760
  76. data/rdoc/classes/NewRelic/Control/External.html +0 -148
  77. data/rdoc/classes/NewRelic/Control/Merb.html +0 -227
  78. data/rdoc/classes/NewRelic/Control/Rails.html +0 -542
  79. data/rdoc/classes/NewRelic/Control/Ruby.html +0 -266
  80. data/rdoc/classes/NewRelic/Control/Sinatra.html +0 -178
  81. data/rdoc/classes/NewRelic/DelayedJobInjection.html +0 -118
  82. data/rdoc/classes/NewRelic/Histogram.html +0 -226
  83. data/rdoc/classes/NewRelic/Histogram/Bucket.html +0 -319
  84. data/rdoc/classes/NewRelic/Histogram/Shim.html +0 -144
  85. data/rdoc/classes/NewRelic/LocalEnvironment.html +0 -572
  86. data/rdoc/classes/NewRelic/MerbBootLoader.html +0 -146
  87. data/rdoc/classes/NewRelic/MethodTraceStats.html +0 -250
  88. data/rdoc/classes/NewRelic/MetricData.html +0 -347
  89. data/rdoc/classes/NewRelic/MetricParser.html +0 -747
  90. data/rdoc/classes/NewRelic/MetricParser/ActionMailer.html +0 -170
  91. data/rdoc/classes/NewRelic/MetricParser/ActiveMerchant.html +0 -267
  92. data/rdoc/classes/NewRelic/MetricParser/ActiveRecord.html +0 -250
  93. data/rdoc/classes/NewRelic/MetricParser/Controller.html +0 -363
  94. data/rdoc/classes/NewRelic/MetricParser/ControllerCPU.html +0 -319
  95. data/rdoc/classes/NewRelic/MetricParser/Errors.html +0 -170
  96. data/rdoc/classes/NewRelic/MetricParser/External.html +0 -339
  97. data/rdoc/classes/NewRelic/MetricParser/MemCache.html +0 -340
  98. data/rdoc/classes/NewRelic/MetricParser/OtherTransaction.html +0 -205
  99. data/rdoc/classes/NewRelic/MetricParser/View.html +0 -381
  100. data/rdoc/classes/NewRelic/MetricParser/WebFrontend.html +0 -182
  101. data/rdoc/classes/NewRelic/MetricParser/WebService.html +0 -172
  102. data/rdoc/classes/NewRelic/MetricSpec.html +0 -406
  103. data/rdoc/classes/NewRelic/Metrics.html +0 -138
  104. data/rdoc/classes/NewRelic/NoticedError.html +0 -200
  105. data/rdoc/classes/NewRelic/Rack.html +0 -112
  106. data/rdoc/classes/NewRelic/Rack/MetricApp.html +0 -193
  107. data/rdoc/classes/NewRelic/Rack/Status.html +0 -165
  108. data/rdoc/classes/NewRelic/ScopedMethodTraceStats.html +0 -225
  109. data/rdoc/classes/NewRelic/Stats.html +0 -917
  110. data/rdoc/classes/NewRelic/StatsBase.html +0 -346
  111. data/rdoc/classes/NewRelic/TransactionAnalysis.html +0 -269
  112. data/rdoc/classes/NewRelic/TransactionAnalysis/SegmentSummary.html +0 -338
  113. data/rdoc/classes/NewRelic/TransactionSample.html +0 -766
  114. data/rdoc/classes/NewRelic/TransactionSample/CompositeSegment.html +0 -195
  115. data/rdoc/classes/NewRelic/TransactionSample/FakeSegment.html +0 -113
  116. data/rdoc/classes/NewRelic/TransactionSample/IDGenerator.html +0 -178
  117. data/rdoc/classes/NewRelic/TransactionSample/Segment.html +0 -920
  118. data/rdoc/classes/NewRelic/TransactionSample/SummarySegment.html +0 -180
  119. data/rdoc/classes/NewRelic/VersionNumber.html +0 -338
  120. data/rdoc/classes/NewRelicApi.html +0 -270
  121. data/rdoc/classes/NewRelicApi/Account.html +0 -178
  122. data/rdoc/classes/NewRelicApi/Account/AccountUsage.html +0 -111
  123. data/rdoc/classes/NewRelicApi/Account/AccountView.html +0 -146
  124. data/rdoc/classes/NewRelicApi/Application.html +0 -139
  125. data/rdoc/classes/NewRelicApi/Application/Agent.html +0 -119
  126. data/rdoc/classes/NewRelicApi/Deployment.html +0 -123
  127. data/rdoc/classes/NewRelicApi/Subscription.html +0 -111
  128. data/rdoc/classes/NewRelicApi/ThresholdValue.html +0 -174
  129. data/rdoc/classes/NewRelicApi/User.html +0 -111
  130. data/rdoc/created.rid +0 -1
  131. data/rdoc/files/CHANGELOG.html +0 -649
  132. data/rdoc/files/LICENSE.html +0 -143
  133. data/rdoc/files/lib/new_relic/agent/agent_rb.html +0 -113
  134. data/rdoc/files/lib/new_relic/agent/busy_calculator_rb.html +0 -115
  135. data/rdoc/files/lib/new_relic/agent/chained_call_rb.html +0 -107
  136. data/rdoc/files/lib/new_relic/agent/collection_helper_rb.html +0 -101
  137. data/rdoc/files/lib/new_relic/agent/error_collector_rb.html +0 -101
  138. data/rdoc/files/lib/new_relic/agent/instrumentation/active_merchant_rb.html +0 -107
  139. data/rdoc/files/lib/new_relic/agent/instrumentation/active_record_instrumentation_rb.html +0 -108
  140. data/rdoc/files/lib/new_relic/agent/instrumentation/authlogic_rb.html +0 -101
  141. data/rdoc/files/lib/new_relic/agent/instrumentation/controller_instrumentation_rb.html +0 -108
  142. data/rdoc/files/lib/new_relic/agent/instrumentation/data_mapper_rb.html +0 -191
  143. data/rdoc/files/lib/new_relic/agent/instrumentation/delayed_job_instrumentation_rb.html +0 -109
  144. data/rdoc/files/lib/new_relic/agent/instrumentation/memcache_rb.html +0 -152
  145. data/rdoc/files/lib/new_relic/agent/instrumentation/merb/controller_rb.html +0 -155
  146. data/rdoc/files/lib/new_relic/agent/instrumentation/merb/errors_rb.html +0 -107
  147. data/rdoc/files/lib/new_relic/agent/instrumentation/metric_frame_rb.html +0 -113
  148. data/rdoc/files/lib/new_relic/agent/instrumentation/net_rb.html +0 -172
  149. data/rdoc/files/lib/new_relic/agent/instrumentation/passenger_instrumentation_rb.html +0 -101
  150. data/rdoc/files/lib/new_relic/agent/instrumentation/rack_rb.html +0 -108
  151. data/rdoc/files/lib/new_relic/agent/instrumentation/rails/action_controller_rb.html +0 -152
  152. data/rdoc/files/lib/new_relic/agent/instrumentation/rails/action_web_service_rb.html +0 -108
  153. data/rdoc/files/lib/new_relic/agent/instrumentation/rails/errors_rb.html +0 -167
  154. data/rdoc/files/lib/new_relic/agent/instrumentation/sinatra_rb.html +0 -108
  155. data/rdoc/files/lib/new_relic/agent/method_tracer_rb.html +0 -108
  156. data/rdoc/files/lib/new_relic/agent/sampler_rb.html +0 -116
  157. data/rdoc/files/lib/new_relic/agent/samplers/cpu_sampler_rb.html +0 -101
  158. data/rdoc/files/lib/new_relic/agent/samplers/delayed_job_lock_sampler_rb.html +0 -101
  159. data/rdoc/files/lib/new_relic/agent/samplers/memory_sampler_rb.html +0 -101
  160. data/rdoc/files/lib/new_relic/agent/samplers/object_sampler_rb.html +0 -101
  161. data/rdoc/files/lib/new_relic/agent/shim_agent_rb.html +0 -108
  162. data/rdoc/files/lib/new_relic/agent/stats_engine/metric_stats_rb.html +0 -101
  163. data/rdoc/files/lib/new_relic/agent/stats_engine/samplers_rb.html +0 -101
  164. data/rdoc/files/lib/new_relic/agent/stats_engine/transactions_rb.html +0 -101
  165. data/rdoc/files/lib/new_relic/agent/stats_engine_rb.html +0 -110
  166. data/rdoc/files/lib/new_relic/agent/transaction_sampler_rb.html +0 -101
  167. data/rdoc/files/lib/new_relic/agent/worker_loop_rb.html +0 -101
  168. data/rdoc/files/lib/new_relic/agent_rb.html +0 -204
  169. data/rdoc/files/lib/new_relic/commands/deployments_rb.html +0 -119
  170. data/rdoc/files/lib/new_relic/commands/new_relic_commands_rb.html +0 -108
  171. data/rdoc/files/lib/new_relic/control/external_rb.html +0 -117
  172. data/rdoc/files/lib/new_relic/control/merb_rb.html +0 -101
  173. data/rdoc/files/lib/new_relic/control/rails_rb.html +0 -108
  174. data/rdoc/files/lib/new_relic/control/ruby_rb.html +0 -110
  175. data/rdoc/files/lib/new_relic/control/sinatra_rb.html +0 -108
  176. data/rdoc/files/lib/new_relic/control_rb.html +0 -116
  177. data/rdoc/files/lib/new_relic/delayed_job_injection_rb.html +0 -180
  178. data/rdoc/files/lib/new_relic/histogram_rb.html +0 -114
  179. data/rdoc/files/lib/new_relic/local_environment_rb.html +0 -111
  180. data/rdoc/files/lib/new_relic/merbtasks_rb.html +0 -101
  181. data/rdoc/files/lib/new_relic/metric_data_rb.html +0 -101
  182. data/rdoc/files/lib/new_relic/metric_parser/action_mailer_rb.html +0 -101
  183. data/rdoc/files/lib/new_relic/metric_parser/active_merchant_rb.html +0 -101
  184. data/rdoc/files/lib/new_relic/metric_parser/active_record_rb.html +0 -101
  185. data/rdoc/files/lib/new_relic/metric_parser/controller_cpu_rb.html +0 -101
  186. data/rdoc/files/lib/new_relic/metric_parser/controller_rb.html +0 -101
  187. data/rdoc/files/lib/new_relic/metric_parser/errors_rb.html +0 -101
  188. data/rdoc/files/lib/new_relic/metric_parser/external_rb.html +0 -101
  189. data/rdoc/files/lib/new_relic/metric_parser/mem_cache_rb.html +0 -101
  190. data/rdoc/files/lib/new_relic/metric_parser/other_transaction_rb.html +0 -108
  191. data/rdoc/files/lib/new_relic/metric_parser/view_rb.html +0 -101
  192. data/rdoc/files/lib/new_relic/metric_parser/web_frontend_rb.html +0 -107
  193. data/rdoc/files/lib/new_relic/metric_parser/web_service_rb.html +0 -101
  194. data/rdoc/files/lib/new_relic/metric_parser_rb.html +0 -101
  195. data/rdoc/files/lib/new_relic/metric_spec_rb.html +0 -108
  196. data/rdoc/files/lib/new_relic/metrics_rb.html +0 -101
  197. data/rdoc/files/lib/new_relic/noticed_error_rb.html +0 -107
  198. data/rdoc/files/lib/new_relic/rack/metric_app_rb.html +0 -108
  199. data/rdoc/files/lib/new_relic/rack_app_rb.html +0 -110
  200. data/rdoc/files/lib/new_relic/recipes_rb.html +0 -128
  201. data/rdoc/files/lib/new_relic/stats_rb.html +0 -101
  202. data/rdoc/files/lib/new_relic/transaction_analysis_rb.html +0 -108
  203. data/rdoc/files/lib/new_relic/transaction_sample_rb.html +0 -101
  204. data/rdoc/files/lib/new_relic/version_rb.html +0 -101
  205. data/rdoc/files/lib/new_relic_api_rb.html +0 -145
  206. data/rdoc/files/lib/newrelic_rpm_rb.html +0 -147
  207. data/rdoc/files/lib/tasks/all_rb.html +0 -107
  208. data/rdoc/fr_class_index.html +0 -134
  209. data/rdoc/fr_file_index.html +0 -103
  210. data/rdoc/fr_method_index.html +0 -568
  211. data/rdoc/index.html +0 -24
  212. data/rdoc/rdoc-style.css +0 -208
@@ -1,742 +0,0 @@
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::Agent::Agent</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::Agent::Agent</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/lib/new_relic/agent/agent_rb.html">
59
- lib/new_relic/agent/agent.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
- Object
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- The <a href="Agent.html">Agent</a> is a singleton that is instantiated when
84
- the plugin is activated.
85
- </p>
86
-
87
- </div>
88
-
89
-
90
- </div>
91
-
92
- <div id="method-list">
93
- <h3 class="section-bar">Methods</h3>
94
-
95
- <div class="name-list">
96
- <a href="#M000248">end_transaction</a>&nbsp;&nbsp;
97
- <a href="#M000243">ensure_worker_thread_started</a>&nbsp;&nbsp;
98
- <a href="#M000241">instance</a>&nbsp;&nbsp;
99
- <a href="#M000254">log</a>&nbsp;&nbsp;
100
- <a href="#M000242">manual_start</a>&nbsp;&nbsp;
101
- <a href="#M000256">new</a>&nbsp;&nbsp;
102
- <a href="#M000252">pop_trace_execution_flag</a>&nbsp;&nbsp;
103
- <a href="#M000251">push_trace_execution_flag</a>&nbsp;&nbsp;
104
- <a href="#M000244">running?</a>&nbsp;&nbsp;
105
- <a href="#M000249">set_record_sql</a>&nbsp;&nbsp;
106
- <a href="#M000250">set_record_tt</a>&nbsp;&nbsp;
107
- <a href="#M000253">set_sql_obfuscator</a>&nbsp;&nbsp;
108
- <a href="#M000246">shutdown</a>&nbsp;&nbsp;
109
- <a href="#M000255">start</a>&nbsp;&nbsp;
110
- <a href="#M000247">start_transaction</a>&nbsp;&nbsp;
111
- <a href="#M000245">started?</a>&nbsp;&nbsp;
112
- </div>
113
- </div>
114
-
115
- </div>
116
-
117
-
118
- <!-- if includes -->
119
-
120
- <div id="section">
121
-
122
-
123
- <div id="constants-list">
124
- <h3 class="section-bar">Constants</h3>
125
-
126
- <div class="name-list">
127
- <table summary="Constants">
128
- <tr class="top-aligned-row context-row">
129
- <td class="context-item-name">PROTOCOL_VERSION</td>
130
- <td>=</td>
131
- <td class="context-item-value">8</td>
132
- <td width="3em">&nbsp;</td>
133
- <td class="context-item-desc">
134
- Specifies the version of the agent&#8216;s communication protocol with the
135
- <a href="../../NewRelic.html">NewRelic</a> hosted site.
136
-
137
- </td>
138
- </tr>
139
- </table>
140
- </div>
141
- </div>
142
-
143
-
144
-
145
- <div id="attribute-list">
146
- <h3 class="section-bar">Attributes</h3>
147
-
148
- <div class="name-list">
149
- <table>
150
- <tr class="top-aligned-row context-row">
151
- <td class="context-item-name">error_collector</td>
152
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
153
- <td class="context-item-desc"></td>
154
- </tr>
155
- <tr class="top-aligned-row context-row">
156
- <td class="context-item-name">histogram</td>
157
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
158
- <td class="context-item-desc"></td>
159
- </tr>
160
- <tr class="top-aligned-row context-row">
161
- <td class="context-item-name">metric_ids</td>
162
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
163
- <td class="context-item-desc"></td>
164
- </tr>
165
- <tr class="top-aligned-row context-row">
166
- <td class="context-item-name">obfuscator</td>
167
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
168
- <td class="context-item-desc"></td>
169
- </tr>
170
- <tr class="top-aligned-row context-row">
171
- <td class="context-item-name">record_sql</td>
172
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
173
- <td class="context-item-desc"></td>
174
- </tr>
175
- <tr class="top-aligned-row context-row">
176
- <td class="context-item-name">should_send_errors</td>
177
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
178
- <td class="context-item-desc"></td>
179
- </tr>
180
- <tr class="top-aligned-row context-row">
181
- <td class="context-item-name">stats_engine</td>
182
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
183
- <td class="context-item-desc"></td>
184
- </tr>
185
- <tr class="top-aligned-row context-row">
186
- <td class="context-item-name">task_loop</td>
187
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
188
- <td class="context-item-desc"></td>
189
- </tr>
190
- <tr class="top-aligned-row context-row">
191
- <td class="context-item-name">transaction_sampler</td>
192
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
193
- <td class="context-item-desc"></td>
194
- </tr>
195
- </table>
196
- </div>
197
- </div>
198
-
199
-
200
-
201
- <!-- if method_list -->
202
- <div id="methods">
203
- <h3 class="section-bar">Public Class methods</h3>
204
-
205
- <div id="method-M000241" class="method-detail">
206
- <a name="M000241"></a>
207
-
208
- <div class="method-heading">
209
- <a href="#M000241" class="method-signature">
210
- <span class="method-name">instance</span><span class="method-args">()</span>
211
- </a>
212
- </div>
213
-
214
- <div class="method-description">
215
- <p>
216
- Should only be called by <a href="../Control.html">NewRelic::Control</a>
217
- </p>
218
- <p><a class="source-toggle" href="#"
219
- onclick="toggleCode('M000241-source');return false;">[Source]</a></p>
220
- <div class="method-source-code" id="M000241-source">
221
- <pre>
222
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 34</span>
223
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>
224
- <span class="ruby-ivar">@instance</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>
225
- <span class="ruby-keyword kw">end</span>
226
- </pre>
227
- </div>
228
- </div>
229
- </div>
230
-
231
- <div id="method-M000256" class="method-detail">
232
- <a name="M000256"></a>
233
-
234
- <div class="method-heading">
235
- <a href="#M000256" class="method-signature">
236
- <span class="method-name">new</span><span class="method-args">()</span>
237
- </a>
238
- </div>
239
-
240
- <div class="method-description">
241
- <p><a class="source-toggle" href="#"
242
- onclick="toggleCode('M000256-source');return false;">[Source]</a></p>
243
- <div class="method-source-code" id="M000256-source">
244
- <pre>
245
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 291</span>
246
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
247
- <span class="ruby-ivar">@connected</span> = <span class="ruby-keyword kw">false</span>
248
- <span class="ruby-ivar">@launch_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
249
-
250
- <span class="ruby-ivar">@metric_ids</span> = {}
251
- <span class="ruby-ivar">@histogram</span> = <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Histogram</span>.<span class="ruby-identifier">new</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-identifier">apdex_t</span> <span class="ruby-operator">/</span> <span class="ruby-value">10</span>)
252
- <span class="ruby-ivar">@stats_engine</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">StatsEngine</span>.<span class="ruby-identifier">new</span>
253
- <span class="ruby-ivar">@transaction_sampler</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">TransactionSampler</span>.<span class="ruby-identifier">new</span>
254
- <span class="ruby-ivar">@stats_engine</span>.<span class="ruby-identifier">transaction_sampler</span> = <span class="ruby-ivar">@transaction_sampler</span>
255
- <span class="ruby-ivar">@error_collector</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">ErrorCollector</span>.<span class="ruby-identifier">new</span>
256
-
257
- <span class="ruby-ivar">@request_timeout</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-identifier">fetch</span>(<span class="ruby-value str">'timeout'</span>, <span class="ruby-value">2</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>)
258
-
259
- <span class="ruby-ivar">@invalid_license</span> = <span class="ruby-keyword kw">false</span>
260
-
261
- <span class="ruby-ivar">@last_harvest_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
262
- <span class="ruby-ivar">@obfuscator</span> = <span class="ruby-identifier">method</span>(<span class="ruby-identifier">:default_sql_obfuscator</span>)
263
- <span class="ruby-keyword kw">end</span>
264
- </pre>
265
- </div>
266
- </div>
267
- </div>
268
-
269
- <h3 class="section-bar">Public Instance methods</h3>
270
-
271
- <div id="method-M000248" class="method-detail">
272
- <a name="M000248"></a>
273
-
274
- <div class="method-heading">
275
- <a href="#M000248" class="method-signature">
276
- <span class="method-name">end_transaction</span><span class="method-args">()</span>
277
- </a>
278
- </div>
279
-
280
- <div class="method-description">
281
- <p><a class="source-toggle" href="#"
282
- onclick="toggleCode('M000248-source');return false;">[Source]</a></p>
283
- <div class="method-source-code" id="M000248-source">
284
- <pre>
285
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 99</span>
286
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">end_transaction</span>
287
- <span class="ruby-ivar">@stats_engine</span>.<span class="ruby-identifier">end_transaction</span>
288
- <span class="ruby-keyword kw">end</span>
289
- </pre>
290
- </div>
291
- </div>
292
- </div>
293
-
294
- <div id="method-M000243" class="method-detail">
295
- <a name="M000243"></a>
296
-
297
- <div class="method-heading">
298
- <a href="#M000243" class="method-signature">
299
- <span class="method-name">ensure_worker_thread_started</span><span class="method-args">()</span>
300
- </a>
301
- </div>
302
-
303
- <div class="method-description">
304
- <p>
305
- this method makes sure that the agent is running. it&#8216;s important for
306
- passenger where processes are forked and the agent is dormant
307
- </p>
308
- <p><a class="source-toggle" href="#"
309
- onclick="toggleCode('M000243-source');return false;">[Source]</a></p>
310
- <div class="method-source-code" id="M000243-source">
311
- <pre>
312
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 46</span>
313
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ensure_worker_thread_started</span>
314
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">agent_enabled?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">monitor_mode?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@invalid_license</span>
315
- <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">running?</span>
316
- <span class="ruby-comment cmt"># We got some reports of threading errors in Unicorn with this.</span>
317
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">debug</span> <span class="ruby-value str">&quot;Detected that the worker loop is not running. Restarting.&quot;</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
318
- <span class="ruby-comment cmt"># Assume we've been forked, clear out stats that are left over from parent process</span>
319
- <span class="ruby-identifier">reset_stats</span>
320
- <span class="ruby-identifier">launch_worker_thread</span>
321
- <span class="ruby-ivar">@stats_engine</span>.<span class="ruby-identifier">spawn_sampler_thread</span>
322
- <span class="ruby-keyword kw">end</span>
323
- <span class="ruby-keyword kw">end</span>
324
- </pre>
325
- </div>
326
- </div>
327
- </div>
328
-
329
- <div id="method-M000254" class="method-detail">
330
- <a name="M000254"></a>
331
-
332
- <div class="method-heading">
333
- <a href="#M000254" class="method-signature">
334
- <span class="method-name">log</span><span class="method-args">()</span>
335
- </a>
336
- </div>
337
-
338
- <div class="method-description">
339
- <p><a class="source-toggle" href="#"
340
- onclick="toggleCode('M000254-source');return false;">[Source]</a></p>
341
- <div class="method-source-code" id="M000254-source">
342
- <pre>
343
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 138</span>
344
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>
345
- <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-identifier">log</span>
346
- <span class="ruby-keyword kw">end</span>
347
- </pre>
348
- </div>
349
- </div>
350
- </div>
351
-
352
- <div id="method-M000242" class="method-detail">
353
- <a name="M000242"></a>
354
-
355
- <div class="method-heading">
356
- <a href="#M000242" class="method-signature">
357
- <span class="method-name">manual_start</span><span class="method-args">(ignored=nil, also_ignored=nil)</span>
358
- </a>
359
- </div>
360
-
361
- <div class="method-description">
362
- <p>
363
- This method is deprecated. Use <a
364
- href="Agent.html#M000242">NewRelic::Agent.manual_start</a>
365
- </p>
366
- <p><a class="source-toggle" href="#"
367
- onclick="toggleCode('M000242-source');return false;">[Source]</a></p>
368
- <div class="method-source-code" id="M000242-source">
369
- <pre>
370
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 38</span>
371
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">manual_start</span>(<span class="ruby-identifier">ignored</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">also_ignored</span>=<span class="ruby-keyword kw">nil</span>)
372
- <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;This method no longer supported. Instead use the class method NewRelic::Agent.manual_start&quot;</span>
373
- <span class="ruby-keyword kw">end</span>
374
- </pre>
375
- </div>
376
- </div>
377
- </div>
378
-
379
- <div id="method-M000252" class="method-detail">
380
- <a name="M000252"></a>
381
-
382
- <div class="method-heading">
383
- <a href="#M000252" class="method-signature">
384
- <span class="method-name">pop_trace_execution_flag</span><span class="method-args">()</span>
385
- </a>
386
- </div>
387
-
388
- <div class="method-description">
389
- <p>
390
- Pop the current trace execution status. Restore trace execution status to
391
- what it was before we pushed the current flag.
392
- </p>
393
- <p><a class="source-toggle" href="#"
394
- onclick="toggleCode('M000252-source');return false;">[Source]</a></p>
395
- <div class="method-source-code" id="M000252-source">
396
- <pre>
397
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 122</span>
398
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pop_trace_execution_flag</span>
399
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:newrelic_untraced</span>].<span class="ruby-identifier">pop</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:newrelic_untraced</span>]
400
- <span class="ruby-keyword kw">end</span>
401
- </pre>
402
- </div>
403
- </div>
404
- </div>
405
-
406
- <div id="method-M000251" class="method-detail">
407
- <a name="M000251"></a>
408
-
409
- <div class="method-heading">
410
- <a href="#M000251" class="method-signature">
411
- <span class="method-name">push_trace_execution_flag</span><span class="method-args">(should_trace=false)</span>
412
- </a>
413
- </div>
414
-
415
- <div class="method-description">
416
- <p>
417
- Push flag indicating whether we should be tracing in this thread.
418
- </p>
419
- <p><a class="source-toggle" href="#"
420
- onclick="toggleCode('M000251-source');return false;">[Source]</a></p>
421
- <div class="method-source-code" id="M000251-source">
422
- <pre>
423
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 116</span>
424
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">push_trace_execution_flag</span>(<span class="ruby-identifier">should_trace</span>=<span class="ruby-keyword kw">false</span>)
425
- (<span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:newrelic_untraced</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">should_trace</span>
426
- <span class="ruby-keyword kw">end</span>
427
- </pre>
428
- </div>
429
- </div>
430
- </div>
431
-
432
- <div id="method-M000244" class="method-detail">
433
- <a name="M000244"></a>
434
-
435
- <div class="method-heading">
436
- <a href="#M000244" class="method-signature">
437
- <span class="method-name">running?</span><span class="method-args">()</span>
438
- </a>
439
- </div>
440
-
441
- <div class="method-description">
442
- <p>
443
- True if the worker thread has been started. Doesn&#8216;t necessarily mean
444
- we are connected
445
- </p>
446
- <p><a class="source-toggle" href="#"
447
- onclick="toggleCode('M000244-source');return false;">[Source]</a></p>
448
- <div class="method-source-code" id="M000244-source">
449
- <pre>
450
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 60</span>
451
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">running?</span>
452
- <span class="ruby-identifier">control</span>.<span class="ruby-identifier">agent_enabled?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">monitor_mode?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@task_loop</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@task_loop</span>.<span class="ruby-identifier">pid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">$$</span>
453
- <span class="ruby-keyword kw">end</span>
454
- </pre>
455
- </div>
456
- </div>
457
- </div>
458
-
459
- <div id="method-M000249" class="method-detail">
460
- <a name="M000249"></a>
461
-
462
- <div class="method-heading">
463
- <a href="#M000249" class="method-signature">
464
- <span class="method-name">set_record_sql</span><span class="method-args">(should_record)</span>
465
- </a>
466
- </div>
467
-
468
- <div class="method-description">
469
- <p><a class="source-toggle" href="#"
470
- onclick="toggleCode('M000249-source');return false;">[Source]</a></p>
471
- <div class="method-source-code" id="M000249-source">
472
- <pre>
473
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 103</span>
474
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_record_sql</span>(<span class="ruby-identifier">should_record</span>)
475
- <span class="ruby-identifier">prev</span> = <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>[<span class="ruby-identifier">:record_sql</span>]
476
- <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>[<span class="ruby-identifier">:record_sql</span>] = <span class="ruby-identifier">should_record</span>
477
- <span class="ruby-identifier">prev</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prev</span>
478
- <span class="ruby-keyword kw">end</span>
479
- </pre>
480
- </div>
481
- </div>
482
- </div>
483
-
484
- <div id="method-M000250" class="method-detail">
485
- <a name="M000250"></a>
486
-
487
- <div class="method-heading">
488
- <a href="#M000250" class="method-signature">
489
- <span class="method-name">set_record_tt</span><span class="method-args">(should_record)</span>
490
- </a>
491
- </div>
492
-
493
- <div class="method-description">
494
- <p><a class="source-toggle" href="#"
495
- onclick="toggleCode('M000250-source');return false;">[Source]</a></p>
496
- <div class="method-source-code" id="M000250-source">
497
- <pre>
498
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 109</span>
499
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_record_tt</span>(<span class="ruby-identifier">should_record</span>)
500
- <span class="ruby-identifier">prev</span> = <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>[<span class="ruby-identifier">:record_tt</span>]
501
- <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>[<span class="ruby-identifier">:record_tt</span>] = <span class="ruby-identifier">should_record</span>
502
- <span class="ruby-identifier">prev</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">prev</span>
503
- <span class="ruby-keyword kw">end</span>
504
- </pre>
505
- </div>
506
- </div>
507
- </div>
508
-
509
- <div id="method-M000253" class="method-detail">
510
- <a name="M000253"></a>
511
-
512
- <div class="method-heading">
513
- <a href="#M000253" class="method-signature">
514
- <span class="method-name">set_sql_obfuscator</span><span class="method-args">(type, &amp;block)</span>
515
- </a>
516
- </div>
517
-
518
- <div class="method-description">
519
- <p><a class="source-toggle" href="#"
520
- onclick="toggleCode('M000253-source');return false;">[Source]</a></p>
521
- <div class="method-source-code" id="M000253-source">
522
- <pre>
523
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 126</span>
524
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_sql_obfuscator</span>(<span class="ruby-identifier">type</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
525
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:before</span>
526
- <span class="ruby-ivar">@obfuscator</span> = <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">ChainedCall</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">block</span>, <span class="ruby-ivar">@obfuscator</span>)
527
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:after</span>
528
- <span class="ruby-ivar">@obfuscator</span> = <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">ChainedCall</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@obfuscator</span>, <span class="ruby-identifier">block</span>)
529
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:replace</span>
530
- <span class="ruby-ivar">@obfuscator</span> = <span class="ruby-identifier">block</span>
531
- <span class="ruby-keyword kw">else</span>
532
- <span class="ruby-identifier">fail</span> <span class="ruby-node">&quot;unknown sql_obfuscator type #{type}&quot;</span>
533
- <span class="ruby-keyword kw">end</span>
534
- <span class="ruby-keyword kw">end</span>
535
- </pre>
536
- </div>
537
- </div>
538
- </div>
539
-
540
- <div id="method-M000246" class="method-detail">
541
- <a name="M000246"></a>
542
-
543
- <div class="method-heading">
544
- <a href="#M000246" class="method-signature">
545
- <span class="method-name">shutdown</span><span class="method-args">()</span>
546
- </a>
547
- </div>
548
-
549
- <div class="method-description">
550
- <p>
551
- Attempt a graceful <a href="Agent.html#M000246">shutdown</a> of the agent.
552
- </p>
553
- <p><a class="source-toggle" href="#"
554
- onclick="toggleCode('M000246-source');return false;">[Source]</a></p>
555
- <div class="method-source-code" id="M000246-source">
556
- <pre>
557
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 70</span>
558
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shutdown</span>
559
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">started?</span>
560
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@task_loop</span>
561
- <span class="ruby-ivar">@task_loop</span>.<span class="ruby-identifier">stop</span>
562
-
563
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">debug</span> <span class="ruby-value str">&quot;Starting Agent shutdown&quot;</span>
564
-
565
- <span class="ruby-comment cmt"># if litespeed, then ignore all future SIGUSR1 - it's</span>
566
- <span class="ruby-comment cmt"># litespeed trying to shut us down</span>
567
-
568
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">dispatcher</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:litespeed</span>
569
- <span class="ruby-constant">Signal</span>.<span class="ruby-identifier">trap</span>(<span class="ruby-value str">&quot;SIGUSR1&quot;</span>, <span class="ruby-value str">&quot;IGNORE&quot;</span>)
570
- <span class="ruby-constant">Signal</span>.<span class="ruby-identifier">trap</span>(<span class="ruby-value str">&quot;SIGTERM&quot;</span>, <span class="ruby-value str">&quot;IGNORE&quot;</span>)
571
- <span class="ruby-keyword kw">end</span>
572
-
573
- <span class="ruby-keyword kw">begin</span>
574
- <span class="ruby-identifier">graceful_disconnect</span>
575
- <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
576
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">error</span> <span class="ruby-identifier">e</span>
577
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">error</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
578
- <span class="ruby-keyword kw">end</span>
579
- <span class="ruby-keyword kw">end</span>
580
- <span class="ruby-ivar">@started</span> = <span class="ruby-keyword kw">nil</span>
581
- <span class="ruby-keyword kw">end</span>
582
- </pre>
583
- </div>
584
- </div>
585
- </div>
586
-
587
- <div id="method-M000255" class="method-detail">
588
- <a name="M000255"></a>
589
-
590
- <div class="method-heading">
591
- <a href="#M000255" class="method-signature">
592
- <span class="method-name">start</span><span class="method-args">()</span>
593
- </a>
594
- </div>
595
-
596
- <div class="method-description">
597
- <p>
598
- Start up the agent. This verifies that the agent_enabled? is true and
599
- initializes the sampler based on the current controluration settings. Then
600
- it will fire up the background thread for sending data to the server if
601
- applicable.
602
- </p>
603
- <p><a class="source-toggle" href="#"
604
- onclick="toggleCode('M000255-source');return false;">[Source]</a></p>
605
- <div class="method-source-code" id="M000255-source">
606
- <pre>
607
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 146</span>
608
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
609
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">started?</span>
610
- <span class="ruby-identifier">control</span>.<span class="ruby-identifier">log!</span> <span class="ruby-value str">&quot;Agent Started Already!&quot;</span>, <span class="ruby-identifier">:error</span>
611
- <span class="ruby-keyword kw">return</span>
612
- <span class="ruby-keyword kw">end</span>
613
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">control</span>.<span class="ruby-identifier">agent_enabled?</span>
614
-
615
- <span class="ruby-ivar">@local_host</span> = <span class="ruby-identifier">determine_host</span>
616
-
617
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">dispatcher</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">dispatcher</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">empty?</span>
618
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;No dispatcher detected.&quot;</span>
619
- <span class="ruby-keyword kw">else</span>
620
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;Dispatcher: #{control.dispatcher.to_s}&quot;</span>
621
- <span class="ruby-keyword kw">end</span>
622
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;Application: #{control.app_names.join(&quot;, &quot;)}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">app_names</span>.<span class="ruby-identifier">empty?</span>
623
-
624
- <span class="ruby-ivar">@started</span> = <span class="ruby-keyword kw">true</span>
625
-
626
- <span class="ruby-identifier">sampler_config</span> = <span class="ruby-identifier">control</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'transaction_tracer'</span>, {})
627
- <span class="ruby-ivar">@use_transaction_sampler</span> = <span class="ruby-identifier">sampler_config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'enabled'</span>, <span class="ruby-keyword kw">true</span>)
628
-
629
- <span class="ruby-ivar">@record_sql</span> = <span class="ruby-identifier">sampler_config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'record_sql'</span>, <span class="ruby-identifier">:obfuscated</span>).<span class="ruby-identifier">to_sym</span>
630
-
631
- <span class="ruby-comment cmt"># use transaction_threshold: 4.0 to force the TT collection</span>
632
- <span class="ruby-comment cmt"># threshold to 4 seconds</span>
633
- <span class="ruby-comment cmt"># use transaction_threshold: apdex_f to use your apdex t value</span>
634
- <span class="ruby-comment cmt"># multiplied by 4</span>
635
- <span class="ruby-comment cmt"># undefined transaction_threshold defaults to 2.0</span>
636
- <span class="ruby-identifier">apdex_f</span> = <span class="ruby-value">4</span> <span class="ruby-operator">*</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-identifier">apdex_t</span>
637
- <span class="ruby-ivar">@slowest_transaction_threshold</span> = <span class="ruby-identifier">sampler_config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'transaction_threshold'</span>, <span class="ruby-value">2.0</span>)
638
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@slowest_transaction_threshold</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/apdex_f/i</span>
639
- <span class="ruby-ivar">@slowest_transaction_threshold</span> = <span class="ruby-identifier">apdex_f</span>
640
- <span class="ruby-keyword kw">end</span>
641
- <span class="ruby-ivar">@slowest_transaction_threshold</span> = <span class="ruby-ivar">@slowest_transaction_threshold</span>.<span class="ruby-identifier">to_f</span>
642
-
643
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@use_transaction_sampler</span>
644
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;Transaction tracing threshold is #{@slowest_transaction_threshold} seconds.&quot;</span>
645
- <span class="ruby-keyword kw">else</span>
646
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;Transaction tracing not enabled.&quot;</span>
647
- <span class="ruby-keyword kw">end</span>
648
- <span class="ruby-ivar">@explain_threshold</span> = <span class="ruby-identifier">sampler_config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'explain_threshold'</span>, <span class="ruby-value">0</span><span class="ruby-value">.5</span>).<span class="ruby-identifier">to_f</span>
649
- <span class="ruby-ivar">@explain_enabled</span> = <span class="ruby-identifier">sampler_config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'explain_enabled'</span>, <span class="ruby-keyword kw">true</span>)
650
- <span class="ruby-ivar">@random_sample</span> = <span class="ruby-identifier">sampler_config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'random_sample'</span>, <span class="ruby-keyword kw">false</span>)
651
- <span class="ruby-identifier">log</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Agent is configured to send raw SQL to RPM service&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@record_sql</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:raw</span>
652
- <span class="ruby-comment cmt"># Initialize transaction sampler</span>
653
- <span class="ruby-ivar">@transaction_sampler</span>.<span class="ruby-identifier">random_sampling</span> = <span class="ruby-ivar">@random_sample</span>
654
-
655
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">monitor_mode?</span>
656
- <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">control</span>.<span class="ruby-identifier">license_key</span>
657
- <span class="ruby-ivar">@invalid_license</span> = <span class="ruby-keyword kw">true</span>
658
- <span class="ruby-identifier">control</span>.<span class="ruby-identifier">log!</span> <span class="ruby-value str">&quot;No license key found. Please edit your newrelic.yml file and insert your license key.&quot;</span>, <span class="ruby-identifier">:error</span>
659
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">control</span>.<span class="ruby-identifier">license_key</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">!=</span> <span class="ruby-value">40</span>
660
- <span class="ruby-ivar">@invalid_license</span> = <span class="ruby-keyword kw">true</span>
661
- <span class="ruby-identifier">control</span>.<span class="ruby-identifier">log!</span> <span class="ruby-node">&quot;Invalid license key: #{control.license_key}&quot;</span>, <span class="ruby-identifier">:error</span>
662
- <span class="ruby-keyword kw">else</span>
663
- <span class="ruby-identifier">launch_worker_thread</span>
664
- <span class="ruby-comment cmt"># When the VM shuts down, attempt to send a message to the</span>
665
- <span class="ruby-comment cmt"># server that this agent run is stopping, assuming it has</span>
666
- <span class="ruby-comment cmt"># successfully connected</span>
667
- <span class="ruby-comment cmt"># This shutdown handler doesn't work if Sinatra is running</span>
668
- <span class="ruby-comment cmt"># because it executes in the shutdown handler!</span>
669
- <span class="ruby-identifier">at_exit</span> { <span class="ruby-identifier">shutdown</span> } <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:sinatra</span>, <span class="ruby-identifier">:unicorn</span>].<span class="ruby-identifier">include?</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-identifier">dispatcher</span>
670
- <span class="ruby-keyword kw">end</span>
671
- <span class="ruby-keyword kw">end</span>
672
- <span class="ruby-identifier">control</span>.<span class="ruby-identifier">log!</span> <span class="ruby-node">&quot;New Relic RPM Agent #{NewRelic::VERSION::STRING} Initialized: pid = #{$$}&quot;</span>
673
- <span class="ruby-identifier">control</span>.<span class="ruby-identifier">log!</span> <span class="ruby-node">&quot;Agent Log found in #{NewRelic::Control.instance.log_file}&quot;</span> <span class="ruby-keyword kw">if</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-identifier">log_file</span>
674
- <span class="ruby-keyword kw">end</span>
675
- </pre>
676
- </div>
677
- </div>
678
- </div>
679
-
680
- <div id="method-M000247" class="method-detail">
681
- <a name="M000247"></a>
682
-
683
- <div class="method-heading">
684
- <a href="#M000247" class="method-signature">
685
- <span class="method-name">start_transaction</span><span class="method-args">()</span>
686
- </a>
687
- </div>
688
-
689
- <div class="method-description">
690
- <p><a class="source-toggle" href="#"
691
- onclick="toggleCode('M000247-source');return false;">[Source]</a></p>
692
- <div class="method-source-code" id="M000247-source">
693
- <pre>
694
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 95</span>
695
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_transaction</span>
696
- <span class="ruby-ivar">@stats_engine</span>.<span class="ruby-identifier">start_transaction</span>
697
- <span class="ruby-keyword kw">end</span>
698
- </pre>
699
- </div>
700
- </div>
701
- </div>
702
-
703
- <div id="method-M000245" class="method-detail">
704
- <a name="M000245"></a>
705
-
706
- <div class="method-heading">
707
- <a href="#M000245" class="method-signature">
708
- <span class="method-name">started?</span><span class="method-args">()</span>
709
- </a>
710
- </div>
711
-
712
- <div class="method-description">
713
- <p>
714
- True if we have initialized and completed &#8216;<a
715
- href="Agent.html#M000255">start</a>&#8216;
716
- </p>
717
- <p><a class="source-toggle" href="#"
718
- onclick="toggleCode('M000245-source');return false;">[Source]</a></p>
719
- <div class="method-source-code" id="M000245-source">
720
- <pre>
721
- <span class="ruby-comment cmt"># File lib/new_relic/agent/agent.rb, line 65</span>
722
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">started?</span>
723
- <span class="ruby-ivar">@started</span>
724
- <span class="ruby-keyword kw">end</span>
725
- </pre>
726
- </div>
727
- </div>
728
- </div>
729
-
730
-
731
- </div>
732
-
733
-
734
- </div>
735
-
736
-
737
- <div id="validator-badges">
738
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
739
- </div>
740
-
741
- </body>
742
- </html>