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,112 +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>Module: NewRelic::Agent::Instrumentation::DelayedJobInstrumentation</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>Module</strong></td>
53
- <td class="class-name-in-header">NewRelic::Agent::Instrumentation::DelayedJobInstrumentation</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/instrumentation/delayed_job_instrumentation_rb.html">
59
- lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
-
76
-
77
- </div>
78
-
79
-
80
- </div>
81
-
82
-
83
- <!-- if includes -->
84
- <div id="includes">
85
- <h3 class="section-bar">Included Modules</h3>
86
-
87
- <div id="includes-list">
88
- <span class="include-name"><a href="ControllerInstrumentation.html">NewRelic::Agent::Instrumentation::ControllerInstrumentation</a></span>
89
- </div>
90
- </div>
91
-
92
- <div id="section">
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
- <!-- if method_list -->
102
-
103
-
104
- </div>
105
-
106
-
107
- <div id="validator-badges">
108
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
109
- </div>
110
-
111
- </body>
112
- </html>
@@ -1,1007 +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::Instrumentation::MetricFrame</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::Instrumentation::MetricFrame</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/instrumentation/metric_frame_rb.html">
59
- lib/new_relic/agent/instrumentation/metric_frame.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
-
82
-
83
- </div>
84
-
85
- <div id="method-list">
86
- <h3 class="section-bar">Methods</h3>
87
-
88
- <div class="name-list">
89
- <a href="#M000178">abort_transaction!</a>&nbsp;&nbsp;
90
- <a href="#M000181">abort_transaction!</a>&nbsp;&nbsp;
91
- <a href="#M000194">add_custom_parameters</a>&nbsp;&nbsp;
92
- <a href="#M000187">add_custom_parameters</a>&nbsp;&nbsp;
93
- <a href="#M000183">category</a>&nbsp;&nbsp;
94
- <a href="#M000174">current</a>&nbsp;&nbsp;
95
- <a href="#M000193">custom_parameters</a>&nbsp;&nbsp;
96
- <a href="#M000188">custom_parameters</a>&nbsp;&nbsp;
97
- <a href="#M000175">database_metric_name</a>&nbsp;&nbsp;
98
- <a href="#M000190">metric_name</a>&nbsp;&nbsp;
99
- <a href="#M000176">new</a>&nbsp;&nbsp;
100
- <a href="#M000186">notice_error</a>&nbsp;&nbsp;
101
- <a href="#M000184">path</a>&nbsp;&nbsp;
102
- <a href="#M000185">pop</a>&nbsp;&nbsp;
103
- <a href="#M000177">push</a>&nbsp;&nbsp;
104
- <a href="#M000189">record_apdex</a>&nbsp;&nbsp;
105
- <a href="#M000191">recorded_metrics</a>&nbsp;&nbsp;
106
- <a href="#M000195">recording_web_transaction?</a>&nbsp;&nbsp;
107
- <a href="#M000196">recording_web_transaction?</a>&nbsp;&nbsp;
108
- <a href="#M000180">referer</a>&nbsp;&nbsp;
109
- <a href="#M000197">referer_from_request</a>&nbsp;&nbsp;
110
- <a href="#M000182">start_transaction</a>&nbsp;&nbsp;
111
- <a href="#M000199">update_apdex</a>&nbsp;&nbsp;
112
- <a href="#M000179">uri</a>&nbsp;&nbsp;
113
- <a href="#M000198">uri_from_request</a>&nbsp;&nbsp;
114
- <a href="#M000192">with_database_metric_name</a>&nbsp;&nbsp;
115
- </div>
116
- </div>
117
-
118
- </div>
119
-
120
-
121
- <!-- if includes -->
122
-
123
- <div id="section">
124
-
125
-
126
-
127
-
128
-
129
- <div id="attribute-list">
130
- <h3 class="section-bar">Attributes</h3>
131
-
132
- <div class="name-list">
133
- <table>
134
- <tr class="top-aligned-row context-row">
135
- <td class="context-item-name">apdex_start</td>
136
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
137
- <td class="context-item-desc"></td>
138
- </tr>
139
- <tr class="top-aligned-row context-row">
140
- <td class="context-item-name">database_metric_name</td>
141
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
142
- <td class="context-item-desc"></td>
143
- </tr>
144
- <tr class="top-aligned-row context-row">
145
- <td class="context-item-name">depth</td>
146
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
147
- <td class="context-item-desc"></td>
148
- </tr>
149
- <tr class="top-aligned-row context-row">
150
- <td class="context-item-name">exception</td>
151
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
152
- <td class="context-item-desc"></td>
153
- </tr>
154
- <tr class="top-aligned-row context-row">
155
- <td class="context-item-name">filtered_params</td>
156
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
157
- <td class="context-item-desc"></td>
158
- </tr>
159
- <tr class="top-aligned-row context-row">
160
- <td class="context-item-name">force_flag</td>
161
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
162
- <td class="context-item-desc"></td>
163
- </tr>
164
- <tr class="top-aligned-row context-row">
165
- <td class="context-item-name">jruby_cpu_start</td>
166
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
167
- <td class="context-item-desc"></td>
168
- </tr>
169
- <tr class="top-aligned-row context-row">
170
- <td class="context-item-name">process_cpu_start</td>
171
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
172
- <td class="context-item-desc"></td>
173
- </tr>
174
- <tr class="top-aligned-row context-row">
175
- <td class="context-item-name">request</td>
176
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
177
- <td class="context-item-desc">
178
- Give the <a href="MetricFrame.html#M000174">current</a> metric frame a
179
- request context. Use this to get the URI and <a
180
- href="MetricFrame.html#M000180">referer</a>. The request is interpreted
181
- loosely as a Rack::Request or an ActionController::AbstractRequest.
182
-
183
- </td>
184
- </tr>
185
- <tr class="top-aligned-row context-row">
186
- <td class="context-item-name">start</td>
187
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
188
- <td class="context-item-desc"></td>
189
- </tr>
190
- </table>
191
- </div>
192
- </div>
193
-
194
-
195
-
196
- <!-- if method_list -->
197
- <div id="methods">
198
- <h3 class="section-bar">Public Class methods</h3>
199
-
200
- <div id="method-M000178" class="method-detail">
201
- <a name="M000178"></a>
202
-
203
- <div class="method-heading">
204
- <a href="#M000178" class="method-signature">
205
- <span class="method-name">abort_transaction!</span><span class="method-args">()</span>
206
- </a>
207
- </div>
208
-
209
- <div class="method-description">
210
- <p>
211
- Indicate that you don&#8216;t want to keep the currently saved transaction
212
- information
213
- </p>
214
- <p><a class="source-toggle" href="#"
215
- onclick="toggleCode('M000178-source');return false;">[Source]</a></p>
216
- <div class="method-source-code" id="M000178-source">
217
- <pre>
218
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 60</span>
219
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">abort_transaction!</span>
220
- <span class="ruby-identifier">current</span>.<span class="ruby-identifier">abort_transaction!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current</span>
221
- <span class="ruby-keyword kw">end</span>
222
- </pre>
223
- </div>
224
- </div>
225
- </div>
226
-
227
- <div id="method-M000187" class="method-detail">
228
- <a name="M000187"></a>
229
-
230
- <div class="method-heading">
231
- <a href="#M000187" class="method-signature">
232
- <span class="method-name">add_custom_parameters</span><span class="method-args">(p)</span>
233
- </a>
234
- </div>
235
-
236
- <div class="method-description">
237
- <p>
238
- Add context parameters to the metric frame. This information will be passed
239
- in to errors and transaction traces. Keys and Values should be strings,
240
- numbers or date/times.
241
- </p>
242
- <p><a class="source-toggle" href="#"
243
- onclick="toggleCode('M000187-source');return false;">[Source]</a></p>
244
- <div class="method-source-code" id="M000187-source">
245
- <pre>
246
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 162</span>
247
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_custom_parameters</span>(<span class="ruby-identifier">p</span>)
248
- <span class="ruby-identifier">current</span>.<span class="ruby-identifier">add_custom_parameters</span>(<span class="ruby-identifier">p</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current</span>
249
- <span class="ruby-keyword kw">end</span>
250
- </pre>
251
- </div>
252
- </div>
253
- </div>
254
-
255
- <div id="method-M000174" class="method-detail">
256
- <a name="M000174"></a>
257
-
258
- <div class="method-heading">
259
- <a href="#M000174" class="method-signature">
260
- <span class="method-name">current</span><span class="method-args">(create_if_empty=nil)</span>
261
- </a>
262
- </div>
263
-
264
- <div class="method-description">
265
- <p>
266
- Return the currently active metric frame, or nil. Call with <tt>true</tt>
267
- to create a <a href="MetricFrame.html#M000176">new</a> metric frame if one
268
- is not already on the thread.
269
- </p>
270
- <p><a class="source-toggle" href="#"
271
- onclick="toggleCode('M000174-source');return false;">[Source]</a></p>
272
- <div class="method-source-code" id="M000174-source">
273
- <pre>
274
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 20</span>
275
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">current</span>(<span class="ruby-identifier">create_if_empty</span>=<span class="ruby-keyword kw">nil</span>)
276
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:newrelic_metric_frame</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">create_if_empty</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">new</span>
277
- <span class="ruby-keyword kw">end</span>
278
- </pre>
279
- </div>
280
- </div>
281
- </div>
282
-
283
- <div id="method-M000188" class="method-detail">
284
- <a name="M000188"></a>
285
-
286
- <div class="method-heading">
287
- <a href="#M000188" class="method-signature">
288
- <span class="method-name">custom_parameters</span><span class="method-args">()</span>
289
- </a>
290
- </div>
291
-
292
- <div class="method-description">
293
- <p><a class="source-toggle" href="#"
294
- onclick="toggleCode('M000188-source');return false;">[Source]</a></p>
295
- <div class="method-source-code" id="M000188-source">
296
- <pre>
297
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 166</span>
298
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">custom_parameters</span>
299
- (<span class="ruby-identifier">current</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">current</span>.<span class="ruby-identifier">custom_parameters</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">current</span>.<span class="ruby-identifier">custom_parameters</span> <span class="ruby-operator">:</span> {}
300
- <span class="ruby-keyword kw">end</span>
301
- </pre>
302
- </div>
303
- </div>
304
- </div>
305
-
306
- <div id="method-M000175" class="method-detail">
307
- <a name="M000175"></a>
308
-
309
- <div class="method-heading">
310
- <a href="#M000175" class="method-signature">
311
- <span class="method-name">database_metric_name</span><span class="method-args">()</span>
312
- </a>
313
- </div>
314
-
315
- <div class="method-description">
316
- <p>
317
- This is the name of the model currently assigned to database measurements,
318
- overriding the default.
319
- </p>
320
- <p><a class="source-toggle" href="#"
321
- onclick="toggleCode('M000175-source');return false;">[Source]</a></p>
322
- <div class="method-source-code" id="M000175-source">
323
- <pre>
324
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 26</span>
325
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">database_metric_name</span>
326
- <span class="ruby-identifier">current</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">current</span>.<span class="ruby-identifier">database_metric_name</span>
327
- <span class="ruby-keyword kw">end</span>
328
- </pre>
329
- </div>
330
- </div>
331
- </div>
332
-
333
- <div id="method-M000176" class="method-detail">
334
- <a name="M000176"></a>
335
-
336
- <div class="method-heading">
337
- <a href="#M000176" class="method-signature">
338
- <span class="method-name">new</span><span class="method-args">()</span>
339
- </a>
340
- </div>
341
-
342
- <div class="method-description">
343
- <p><a class="source-toggle" href="#"
344
- onclick="toggleCode('M000176-source');return false;">[Source]</a></p>
345
- <div class="method-source-code" id="M000176-source">
346
- <pre>
347
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 44</span>
348
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
349
- <span class="ruby-ivar">@start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>
350
- <span class="ruby-ivar">@path_stack</span> = [] <span class="ruby-comment cmt"># stack of [controller, path] elements</span>
351
- <span class="ruby-ivar">@jruby_cpu_start</span> = <span class="ruby-identifier">jruby_cpu_time</span>
352
- <span class="ruby-ivar">@process_cpu_start</span> = <span class="ruby-identifier">process_cpu</span>
353
- <span class="ruby-keyword kw">end</span>
354
- </pre>
355
- </div>
356
- </div>
357
- </div>
358
-
359
- <div id="method-M000186" class="method-detail">
360
- <a name="M000186"></a>
361
-
362
- <div class="method-heading">
363
- <a href="#M000186" class="method-signature">
364
- <span class="method-name">notice_error</span><span class="method-args">(e, options={})</span>
365
- </a>
366
- </div>
367
-
368
- <div class="method-description">
369
- <p>
370
- If we have an active metric frame, notice the error and increment the error
371
- metric. Options:
372
- </p>
373
- <ul>
374
- <li><tt>:request</tt> =&gt; Request object to get the <a
375
- href="MetricFrame.html#M000179">uri</a> and <a
376
- href="MetricFrame.html#M000180">referer</a>
377
-
378
- </li>
379
- <li><tt>:<a href="MetricFrame.html#M000179">uri</a></tt> =&gt; The request <a
380
- href="MetricFrame.html#M000184">path</a>, minus any request params or query
381
- string.
382
-
383
- </li>
384
- <li><tt>:<a href="MetricFrame.html#M000180">referer</a></tt> =&gt; The URI of
385
- the <a href="MetricFrame.html#M000180">referer</a>
386
-
387
- </li>
388
- <li><tt>:metric</tt> =&gt; The metric name associated with the transaction
389
-
390
- </li>
391
- <li><tt>:request_params</tt> =&gt; Request parameters, already filtered if
392
- necessary
393
-
394
- </li>
395
- <li><tt>:custom_params</tt> =&gt; Custom parameters
396
-
397
- </li>
398
- </ul>
399
- <p>
400
- Anything left over is treated as custom params
401
- </p>
402
- <p><a class="source-toggle" href="#"
403
- onclick="toggleCode('M000186-source');return false;">[Source]</a></p>
404
- <div class="method-source-code" id="M000186-source">
405
- <pre>
406
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 134</span>
407
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">notice_error</span>(<span class="ruby-identifier">e</span>, <span class="ruby-identifier">options</span>={})
408
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:request</span>)
409
- <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:referer</span>] = <span class="ruby-identifier">referer_from_request</span>(<span class="ruby-identifier">request</span>)
410
- <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:uri</span>] = <span class="ruby-identifier">uri_from_request</span>(<span class="ruby-identifier">request</span>)
411
- <span class="ruby-keyword kw">end</span>
412
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current</span>
413
- <span class="ruby-identifier">current</span>.<span class="ruby-identifier">notice_error</span>(<span class="ruby-identifier">e</span>, <span class="ruby-identifier">options</span>)
414
- <span class="ruby-keyword kw">else</span>
415
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">error_collector</span>.<span class="ruby-identifier">notice_error</span>(<span class="ruby-identifier">e</span>, <span class="ruby-identifier">options</span>)
416
- <span class="ruby-keyword kw">end</span>
417
- <span class="ruby-keyword kw">end</span>
418
- </pre>
419
- </div>
420
- </div>
421
- </div>
422
-
423
- <div id="method-M000195" class="method-detail">
424
- <a name="M000195"></a>
425
-
426
- <div class="method-heading">
427
- <a href="#M000195" class="method-signature">
428
- <span class="method-name">recording_web_transaction?</span><span class="method-args">()</span>
429
- </a>
430
- </div>
431
-
432
- <div class="method-description">
433
- <p><a class="source-toggle" href="#"
434
- onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
435
- <div class="method-source-code" id="M000195-source">
436
- <pre>
437
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 228</span>
438
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">recording_web_transaction?</span>
439
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:newrelic_metric_frame</span>]
440
- <span class="ruby-identifier">c</span>.<span class="ruby-identifier">recording_web_transaction?</span>
441
- <span class="ruby-keyword kw">end</span>
442
- <span class="ruby-keyword kw">end</span>
443
- </pre>
444
- </div>
445
- </div>
446
- </div>
447
-
448
- <div id="method-M000197" class="method-detail">
449
- <a name="M000197"></a>
450
-
451
- <div class="method-heading">
452
- <a href="#M000197" class="method-signature">
453
- <span class="method-name">referer_from_request</span><span class="method-args">(request)</span>
454
- </a>
455
- </div>
456
-
457
- <div class="method-description">
458
- <p>
459
- Make a safe attempt to get the <a
460
- href="MetricFrame.html#M000180">referer</a> from a request object,
461
- generally successful when it&#8216;s a <a href="Rack.html">Rack</a>
462
- request.
463
- </p>
464
- <p><a class="source-toggle" href="#"
465
- onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
466
- <div class="method-source-code" id="M000197-source">
467
- <pre>
468
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 240</span>
469
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">referer_from_request</span>(<span class="ruby-identifier">request</span>)
470
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:referer</span>)
471
- <span class="ruby-identifier">request</span>.<span class="ruby-identifier">referer</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'?'</span>).<span class="ruby-identifier">first</span>
472
- <span class="ruby-keyword kw">end</span>
473
- <span class="ruby-keyword kw">end</span>
474
- </pre>
475
- </div>
476
- </div>
477
- </div>
478
-
479
- <div id="method-M000199" class="method-detail">
480
- <a name="M000199"></a>
481
-
482
- <div class="method-heading">
483
- <a href="#M000199" class="method-signature">
484
- <span class="method-name">update_apdex</span><span class="method-args">(stat, duration, failed)</span>
485
- </a>
486
- </div>
487
-
488
- <div class="method-description">
489
- <p>
490
- Record an apdex value for the given stat. non-nil &#8216;failed&#8217; the
491
- apdex should be recorded as a failure regardless of duration.
492
- </p>
493
- <p><a class="source-toggle" href="#"
494
- onclick="toggleCode('M000199-source');return false;">[Source]</a></p>
495
- <div class="method-source-code" id="M000199-source">
496
- <pre>
497
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 260</span>
498
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">update_apdex</span>(<span class="ruby-identifier">stat</span>, <span class="ruby-identifier">duration</span>, <span class="ruby-identifier">failed</span>)
499
- <span class="ruby-identifier">apdex_t</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>
500
- <span class="ruby-keyword kw">case</span>
501
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">failed</span>
502
- <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">record_apdex_f</span>
503
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">apdex_t</span>
504
- <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">record_apdex_s</span>
505
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">4</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">apdex_t</span>
506
- <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">record_apdex_t</span>
507
- <span class="ruby-keyword kw">else</span>
508
- <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">record_apdex_f</span>
509
- <span class="ruby-keyword kw">end</span>
510
- <span class="ruby-keyword kw">end</span>
511
- </pre>
512
- </div>
513
- </div>
514
- </div>
515
-
516
- <div id="method-M000198" class="method-detail">
517
- <a name="M000198"></a>
518
-
519
- <div class="method-heading">
520
- <a href="#M000198" class="method-signature">
521
- <span class="method-name">uri_from_request</span><span class="method-args">(request)</span>
522
- </a>
523
- </div>
524
-
525
- <div class="method-description">
526
- <p>
527
- Make a safe attempt to get the URI, without the host and query string.
528
- </p>
529
- <p><a class="source-toggle" href="#"
530
- onclick="toggleCode('M000198-source');return false;">[Source]</a></p>
531
- <div class="method-source-code" id="M000198-source">
532
- <pre>
533
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 247</span>
534
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">uri_from_request</span>(<span class="ruby-identifier">request</span>)
535
- <span class="ruby-identifier">approximate_uri</span> = <span class="ruby-keyword kw">case</span>
536
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:fullpath</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">fullpath</span>
537
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:path</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>
538
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:request_uri</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">request_uri</span>
539
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:uri</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">uri</span>
540
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:url</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">url</span>
541
- <span class="ruby-keyword kw">end</span>
542
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">approximate_uri</span>[<span class="ruby-regexp re">%r{^(https?://.*?)?(/[^?]*)}</span>, <span class="ruby-value">2</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'/'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">approximate_uri</span>
543
- <span class="ruby-keyword kw">end</span>
544
- </pre>
545
- </div>
546
- </div>
547
- </div>
548
-
549
- <h3 class="section-bar">Public Instance methods</h3>
550
-
551
- <div id="method-M000181" class="method-detail">
552
- <a name="M000181"></a>
553
-
554
- <div class="method-heading">
555
- <a href="#M000181" class="method-signature">
556
- <span class="method-name">abort_transaction!</span><span class="method-args">()</span>
557
- </a>
558
- </div>
559
-
560
- <div class="method-description">
561
- <p>
562
- Call this to ensure that the <a href="MetricFrame.html#M000174">current</a>
563
- transaction is not saved
564
- </p>
565
- <p><a class="source-toggle" href="#"
566
- onclick="toggleCode('M000181-source');return false;">[Source]</a></p>
567
- <div class="method-source-code" id="M000181-source">
568
- <pre>
569
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 75</span>
570
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">abort_transaction!</span>
571
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">transaction_sampler</span>.<span class="ruby-identifier">ignore_transaction</span>
572
- <span class="ruby-keyword kw">end</span>
573
- </pre>
574
- </div>
575
- </div>
576
- </div>
577
-
578
- <div id="method-M000194" class="method-detail">
579
- <a name="M000194"></a>
580
-
581
- <div class="method-heading">
582
- <a href="#M000194" class="method-signature">
583
- <span class="method-name">add_custom_parameters</span><span class="method-args">(p)</span>
584
- </a>
585
- </div>
586
-
587
- <div class="method-description">
588
- <p><a class="source-toggle" href="#"
589
- onclick="toggleCode('M000194-source');return false;">[Source]</a></p>
590
- <div class="method-source-code" id="M000194-source">
591
- <pre>
592
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 224</span>
593
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_custom_parameters</span>(<span class="ruby-identifier">p</span>)
594
- <span class="ruby-identifier">custom_parameters</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">p</span>)
595
- <span class="ruby-keyword kw">end</span>
596
- </pre>
597
- </div>
598
- </div>
599
- </div>
600
-
601
- <div id="method-M000183" class="method-detail">
602
- <a name="M000183"></a>
603
-
604
- <div class="method-heading">
605
- <a href="#M000183" class="method-signature">
606
- <span class="method-name">category</span><span class="method-args">()</span>
607
- </a>
608
- </div>
609
-
610
- <div class="method-description">
611
- <p><a class="source-toggle" href="#"
612
- onclick="toggleCode('M000183-source');return false;">[Source]</a></p>
613
- <div class="method-source-code" id="M000183-source">
614
- <pre>
615
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 88</span>
616
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">category</span>
617
- <span class="ruby-ivar">@path_stack</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">first</span>
618
- <span class="ruby-keyword kw">end</span>
619
- </pre>
620
- </div>
621
- </div>
622
- </div>
623
-
624
- <div id="method-M000193" class="method-detail">
625
- <a name="M000193"></a>
626
-
627
- <div class="method-heading">
628
- <a href="#M000193" class="method-signature">
629
- <span class="method-name">custom_parameters</span><span class="method-args">()</span>
630
- </a>
631
- </div>
632
-
633
- <div class="method-description">
634
- <p><a class="source-toggle" href="#"
635
- onclick="toggleCode('M000193-source');return false;">[Source]</a></p>
636
- <div class="method-source-code" id="M000193-source">
637
- <pre>
638
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 220</span>
639
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">custom_parameters</span>
640
- <span class="ruby-ivar">@custom_parameters</span> <span class="ruby-operator">||=</span> {}
641
- <span class="ruby-keyword kw">end</span>
642
- </pre>
643
- </div>
644
- </div>
645
- </div>
646
-
647
- <div id="method-M000190" class="method-detail">
648
- <a name="M000190"></a>
649
-
650
- <div class="method-heading">
651
- <a href="#M000190" class="method-signature">
652
- <span class="method-name">metric_name</span><span class="method-args">()</span>
653
- </a>
654
- </div>
655
-
656
- <div class="method-description">
657
- <p><a class="source-toggle" href="#"
658
- onclick="toggleCode('M000190-source');return false;">[Source]</a></p>
659
- <div class="method-source-code" id="M000190-source">
660
- <pre>
661
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 179</span>
662
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">metric_name</span>
663
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@path_stack</span>.<span class="ruby-identifier">empty?</span>
664
- <span class="ruby-identifier">category</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">path</span>
665
- <span class="ruby-keyword kw">end</span>
666
- </pre>
667
- </div>
668
- </div>
669
- </div>
670
-
671
- <div id="method-M000184" class="method-detail">
672
- <a name="M000184"></a>
673
-
674
- <div class="method-heading">
675
- <a href="#M000184" class="method-signature">
676
- <span class="method-name">path</span><span class="method-args">()</span>
677
- </a>
678
- </div>
679
-
680
- <div class="method-description">
681
- <p><a class="source-toggle" href="#"
682
- onclick="toggleCode('M000184-source');return false;">[Source]</a></p>
683
- <div class="method-source-code" id="M000184-source">
684
- <pre>
685
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 92</span>
686
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>
687
- <span class="ruby-ivar">@path_stack</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">last</span>
688
- <span class="ruby-keyword kw">end</span>
689
- </pre>
690
- </div>
691
- </div>
692
- </div>
693
-
694
- <div id="method-M000185" class="method-detail">
695
- <a name="M000185"></a>
696
-
697
- <div class="method-heading">
698
- <a href="#M000185" class="method-signature">
699
- <span class="method-name">pop</span><span class="method-args">()</span>
700
- </a>
701
- </div>
702
-
703
- <div class="method-description">
704
- <p>
705
- Unwind one stack level. It knows if it&#8216;s back at the outermost caller
706
- and does the appropriate wrapup of the context.
707
- </p>
708
- <p><a class="source-toggle" href="#"
709
- onclick="toggleCode('M000185-source');return false;">[Source]</a></p>
710
- <div class="method-source-code" id="M000185-source">
711
- <pre>
712
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 98</span>
713
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pop</span>
714
- <span class="ruby-identifier">category</span>, <span class="ruby-identifier">path</span> = <span class="ruby-ivar">@path_stack</span>.<span class="ruby-identifier">pop</span>
715
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">category</span>.<span class="ruby-identifier">nil?</span>
716
- <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>.<span class="ruby-identifier">error</span> <span class="ruby-node">&quot;Underflow in metric frames: #{caller.join(&quot;\n &quot;)}&quot;</span>
717
- <span class="ruby-keyword kw">end</span>
718
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@path_stack</span>.<span class="ruby-identifier">empty?</span>
719
- <span class="ruby-keyword kw">if</span> <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">is_execution_traced?</span>
720
- <span class="ruby-identifier">cpu_burn</span> = <span class="ruby-keyword kw">nil</span>
721
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@process_cpu_start</span>
722
- <span class="ruby-identifier">cpu_burn</span> = <span class="ruby-identifier">process_cpu</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@process_cpu_start</span>
723
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@jruby_cpu_start</span>
724
- <span class="ruby-identifier">cpu_burn</span> = <span class="ruby-identifier">jruby_cpu_time</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@jruby_cpu_start</span>
725
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">get_stats_no_scope</span>(<span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Metrics</span><span class="ruby-operator">::</span><span class="ruby-constant">USER_TIME</span>).<span class="ruby-identifier">record_data_point</span>(<span class="ruby-identifier">cpu_burn</span>)
726
- <span class="ruby-keyword kw">end</span>
727
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">transaction_sampler</span>.<span class="ruby-identifier">notice_transaction_cpu_time</span>(<span class="ruby-identifier">cpu_burn</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cpu_burn</span>
728
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">histogram</span>.<span class="ruby-identifier">process</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">start</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">recording_web_transaction?</span>(<span class="ruby-identifier">category</span>)
729
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">transaction_sampler</span>.<span class="ruby-identifier">notice_scope_empty</span>
730
- <span class="ruby-keyword kw">end</span>
731
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">stats_engine</span>.<span class="ruby-identifier">end_transaction</span>
732
- <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:newrelic_metric_frame</span>] = <span class="ruby-keyword kw">nil</span>
733
- <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># path stack not empty</span>
734
- <span class="ruby-comment cmt"># change the transaction name back to whatever was on the stack. </span>
735
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">stats_engine</span>.<span class="ruby-identifier">scope_name</span> = <span class="ruby-identifier">metric_name</span>
736
- <span class="ruby-keyword kw">end</span>
737
- <span class="ruby-keyword kw">end</span>
738
- </pre>
739
- </div>
740
- </div>
741
- </div>
742
-
743
- <div id="method-M000177" class="method-detail">
744
- <a name="M000177"></a>
745
-
746
- <div class="method-heading">
747
- <a href="#M000177" class="method-signature">
748
- <span class="method-name">push</span><span class="method-args">(category, path)</span>
749
- </a>
750
- </div>
751
-
752
- <div class="method-description">
753
- <p>
754
- Indicate that we are entering a measured controller action or task. Make
755
- sure you unwind every <a href="MetricFrame.html#M000177">push</a> with a <a
756
- href="MetricFrame.html#M000185">pop</a> call.
757
- </p>
758
- <p><a class="source-toggle" href="#"
759
- onclick="toggleCode('M000177-source');return false;">[Source]</a></p>
760
- <div class="method-source-code" id="M000177-source">
761
- <pre>
762
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 53</span>
763
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">push</span>(<span class="ruby-identifier">category</span>, <span class="ruby-identifier">path</span>)
764
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">transaction_sampler</span>.<span class="ruby-identifier">notice_first_scope_push</span>(<span class="ruby-identifier">start</span>)
765
- <span class="ruby-ivar">@path_stack</span>.<span class="ruby-identifier">push</span> [<span class="ruby-identifier">category</span>, <span class="ruby-identifier">path</span>]
766
- <span class="ruby-keyword kw">end</span>
767
- </pre>
768
- </div>
769
- </div>
770
- </div>
771
-
772
- <div id="method-M000189" class="method-detail">
773
- <a name="M000189"></a>
774
-
775
- <div class="method-heading">
776
- <a href="#M000189" class="method-signature">
777
- <span class="method-name">record_apdex</span><span class="method-args">()</span>
778
- </a>
779
- </div>
780
-
781
- <div class="method-description">
782
- <p><a class="source-toggle" href="#"
783
- onclick="toggleCode('M000189-source');return false;">[Source]</a></p>
784
- <div class="method-source-code" id="M000189-source">
785
- <pre>
786
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 170</span>
787
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record_apdex</span>
788
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">recording_web_transaction?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">is_execution_traced?</span>
789
- <span class="ruby-identifier">ending</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>
790
- <span class="ruby-identifier">summary_stat</span> = <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">stats_engine</span>.<span class="ruby-identifier">get_custom_stats</span>(<span class="ruby-value str">&quot;Apdex&quot;</span>, <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">ApdexStats</span>)
791
- <span class="ruby-identifier">controller_stat</span> = <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">stats_engine</span>.<span class="ruby-identifier">get_custom_stats</span>(<span class="ruby-node">&quot;Apdex/#{path}&quot;</span>, <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">ApdexStats</span>)
792
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">update_apdex</span>(<span class="ruby-identifier">summary_stat</span>, <span class="ruby-identifier">ending</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">apdex_start</span>, <span class="ruby-identifier">exception</span>)
793
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">update_apdex</span>(<span class="ruby-identifier">controller_stat</span>, <span class="ruby-identifier">ending</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">start</span>, <span class="ruby-identifier">exception</span>)
794
- <span class="ruby-keyword kw">end</span>
795
- </pre>
796
- </div>
797
- </div>
798
- </div>
799
-
800
- <div id="method-M000191" class="method-detail">
801
- <a name="M000191"></a>
802
-
803
- <div class="method-heading">
804
- <a href="#M000191" class="method-signature">
805
- <span class="method-name">recorded_metrics</span><span class="method-args">()</span>
806
- </a>
807
- </div>
808
-
809
- <div class="method-description">
810
- <p>
811
- Return the array of metrics to record for the <a
812
- href="MetricFrame.html#M000174">current</a> metric frame.
813
- </p>
814
- <p><a class="source-toggle" href="#"
815
- onclick="toggleCode('M000191-source');return false;">[Source]</a></p>
816
- <div class="method-source-code" id="M000191-source">
817
- <pre>
818
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 185</span>
819
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">recorded_metrics</span>
820
- <span class="ruby-identifier">metrics</span> = [ <span class="ruby-identifier">metric_name</span> ]
821
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@path_stack</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
822
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">recording_web_transaction?</span>
823
- <span class="ruby-identifier">metrics</span> <span class="ruby-operator">+=</span> [<span class="ruby-value str">&quot;HttpDispatcher&quot;</span>]
824
- <span class="ruby-keyword kw">else</span>
825
- <span class="ruby-identifier">metrics</span> <span class="ruby-operator">+=</span> [<span class="ruby-node">&quot;#{category}/all&quot;</span>, <span class="ruby-value str">&quot;OtherTransaction/all&quot;</span>]
826
- <span class="ruby-keyword kw">end</span>
827
- <span class="ruby-keyword kw">end</span>
828
- <span class="ruby-identifier">metrics</span>
829
- <span class="ruby-keyword kw">end</span>
830
- </pre>
831
- </div>
832
- </div>
833
- </div>
834
-
835
- <div id="method-M000196" class="method-detail">
836
- <a name="M000196"></a>
837
-
838
- <div class="method-heading">
839
- <a href="#M000196" class="method-signature">
840
- <span class="method-name">recording_web_transaction?</span><span class="method-args">(cat = category)</span>
841
- </a>
842
- </div>
843
-
844
- <div class="method-description">
845
- <p><a class="source-toggle" href="#"
846
- onclick="toggleCode('M000196-source');return false;">[Source]</a></p>
847
- <div class="method-source-code" id="M000196-source">
848
- <pre>
849
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 234</span>
850
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">recording_web_transaction?</span>(<span class="ruby-identifier">cat</span> = <span class="ruby-identifier">category</span>)
851
- <span class="ruby-value">0</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">cat</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">&quot;Controller&quot;</span>)
852
- <span class="ruby-keyword kw">end</span>
853
- </pre>
854
- </div>
855
- </div>
856
- </div>
857
-
858
- <div id="method-M000180" class="method-detail">
859
- <a name="M000180"></a>
860
-
861
- <div class="method-heading">
862
- <a href="#M000180" class="method-signature">
863
- <span class="method-name">referer</span><span class="method-args">()</span>
864
- </a>
865
- </div>
866
-
867
- <div class="method-description">
868
- <p>
869
- For the <a href="MetricFrame.html#M000174">current</a> web transaction,
870
- return the full <a href="MetricFrame.html#M000180">referer</a>, minus the
871
- host string, or nil.
872
- </p>
873
- <p><a class="source-toggle" href="#"
874
- onclick="toggleCode('M000180-source');return false;">[Source]</a></p>
875
- <div class="method-source-code" id="M000180-source">
876
- <pre>
877
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 70</span>
878
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">referer</span>
879
- <span class="ruby-ivar">@referer</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">referer_from_request</span>(<span class="ruby-ivar">@request</span>)
880
- <span class="ruby-keyword kw">end</span>
881
- </pre>
882
- </div>
883
- </div>
884
- </div>
885
-
886
- <div id="method-M000182" class="method-detail">
887
- <a name="M000182"></a>
888
-
889
- <div class="method-heading">
890
- <a href="#M000182" class="method-signature">
891
- <span class="method-name">start_transaction</span><span class="method-args">()</span>
892
- </a>
893
- </div>
894
-
895
- <div class="method-description">
896
- <p>
897
- This needs to be called after entering the call to trace the controller
898
- action, otherwise the controller action blames itself. It gets reset in the
899
- normal <a href="MetricFrame.html#M000185">pop</a> call.
900
- </p>
901
- <p><a class="source-toggle" href="#"
902
- onclick="toggleCode('M000182-source');return false;">[Source]</a></p>
903
- <div class="method-source-code" id="M000182-source">
904
- <pre>
905
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 80</span>
906
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_transaction</span>
907
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">stats_engine</span>.<span class="ruby-identifier">start_transaction</span> <span class="ruby-identifier">metric_name</span>
908
- <span class="ruby-comment cmt"># Only push the transaction context info once, on entry:</span>
909
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@path_stack</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
910
- <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">transaction_sampler</span>.<span class="ruby-identifier">notice_transaction</span>(<span class="ruby-identifier">metric_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">filtered_params</span>)
911
- <span class="ruby-keyword kw">end</span>
912
- <span class="ruby-keyword kw">end</span>
913
- </pre>
914
- </div>
915
- </div>
916
- </div>
917
-
918
- <div id="method-M000179" class="method-detail">
919
- <a name="M000179"></a>
920
-
921
- <div class="method-heading">
922
- <a href="#M000179" class="method-signature">
923
- <span class="method-name">uri</span><span class="method-args">()</span>
924
- </a>
925
- </div>
926
-
927
- <div class="method-description">
928
- <p>
929
- For the <a href="MetricFrame.html#M000174">current</a> web transaction,
930
- return the <a href="MetricFrame.html#M000184">path</a> of the URI minus the
931
- host part and query string, or nil.
932
- </p>
933
- <p><a class="source-toggle" href="#"
934
- onclick="toggleCode('M000179-source');return false;">[Source]</a></p>
935
- <div class="method-source-code" id="M000179-source">
936
- <pre>
937
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 65</span>
938
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uri</span>
939
- <span class="ruby-ivar">@uri</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">uri_from_request</span>(<span class="ruby-ivar">@request</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">nil?</span>
940
- <span class="ruby-keyword kw">end</span>
941
- </pre>
942
- </div>
943
- </div>
944
- </div>
945
-
946
- <div id="method-M000192" class="method-detail">
947
- <a name="M000192"></a>
948
-
949
- <div class="method-heading">
950
- <a href="#M000192" class="method-signature">
951
- <span class="method-name">with_database_metric_name</span><span class="method-args">(model, method) {|| ...}</span>
952
- </a>
953
- </div>
954
-
955
- <div class="method-description">
956
- <p>
957
- Yield to a block that is run with a database metric name context. This
958
- means the Database instrumentation will use this for the metric name if it
959
- does not otherwise know about a model. This is re-entrant.
960
- </p>
961
- <ul>
962
- <li><tt>model</tt> is the DB model class
963
-
964
- </li>
965
- <li><tt>method</tt> is the name of the finder method or other method to
966
- identify the operation with.
967
-
968
- </li>
969
- </ul>
970
- <p><a class="source-toggle" href="#"
971
- onclick="toggleCode('M000192-source');return false;">[Source]</a></p>
972
- <div class="method-source-code" id="M000192-source">
973
- <pre>
974
- <span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/metric_frame.rb, line 204</span>
975
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_database_metric_name</span>(<span class="ruby-identifier">model</span>, <span class="ruby-identifier">method</span>)
976
- <span class="ruby-identifier">previous</span> = <span class="ruby-ivar">@database_metric_name</span>
977
- <span class="ruby-identifier">model_name</span> = <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">model</span>
978
- <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Class</span>
979
- <span class="ruby-identifier">model</span>.<span class="ruby-identifier">name</span>
980
- <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
981
- <span class="ruby-identifier">model</span>
982
- <span class="ruby-keyword kw">else</span>
983
- <span class="ruby-identifier">model</span>.<span class="ruby-identifier">to_s</span>
984
- <span class="ruby-keyword kw">end</span>
985
- <span class="ruby-ivar">@database_metric_name</span> = <span class="ruby-node">&quot;ActiveRecord/#{model_name}/#{method}&quot;</span>
986
- <span class="ruby-keyword kw">yield</span>
987
- <span class="ruby-keyword kw">ensure</span>
988
- <span class="ruby-ivar">@database_metric_name</span>=<span class="ruby-identifier">previous</span>
989
- <span class="ruby-keyword kw">end</span>
990
- </pre>
991
- </div>
992
- </div>
993
- </div>
994
-
995
-
996
- </div>
997
-
998
-
999
- </div>
1000
-
1001
-
1002
- <div id="validator-badges">
1003
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
1004
- </div>
1005
-
1006
- </body>
1007
- </html>