newrelic_rpm 2.10.6 → 2.10.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of newrelic_rpm might be problematic. Click here for more details.
- data/CHANGELOG +14 -0
- data/lib/new_relic/agent.rb +5 -4
- data/lib/new_relic/agent/agent.rb +81 -101
- data/lib/new_relic/agent/error_collector.rb +1 -2
- data/lib/new_relic/agent/instrumentation/authlogic.rb +2 -2
- data/lib/new_relic/agent/instrumentation/merb/controller.rb +2 -2
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +45 -0
- data/lib/new_relic/agent/instrumentation/rails3/errors.rb +21 -0
- data/lib/new_relic/agent/method_tracer.rb +2 -2
- data/lib/new_relic/agent/samplers/delayed_job_lock_sampler.rb +1 -1
- data/lib/new_relic/agent/stats_engine/samplers.rb +1 -2
- data/lib/new_relic/agent/transaction_sampler.rb +1 -1
- data/lib/new_relic/agent/worker_loop.rb +47 -86
- data/lib/new_relic/{agent/collection_helper.rb → collection_helper.rb} +2 -4
- data/lib/new_relic/control.rb +18 -2
- data/lib/new_relic/control/rails3.rb +75 -0
- data/lib/new_relic/local_environment.rb +11 -3
- data/lib/new_relic/noticed_error.rb +2 -1
- data/lib/new_relic/version.rb +10 -9
- data/newrelic_rpm.gemspec +195 -3
- data/rdoc/classes/NewRelic.html +293 -0
- data/rdoc/classes/NewRelic/Agent.html +810 -0
- data/rdoc/classes/NewRelic/Agent/Agent.html +742 -0
- data/rdoc/classes/NewRelic/Agent/BackgroundLoadingError.html +111 -0
- data/rdoc/classes/NewRelic/Agent/BusyCalculator.html +309 -0
- data/rdoc/classes/NewRelic/Agent/CollectionHelper.html +196 -0
- data/rdoc/classes/NewRelic/Agent/ErrorCollector.html +378 -0
- data/rdoc/classes/NewRelic/Agent/ForceDisconnectException.html +118 -0
- data/rdoc/classes/NewRelic/Agent/ForceRestartException.html +117 -0
- data/rdoc/classes/NewRelic/Agent/IgnoreSilentlyException.html +118 -0
- data/rdoc/classes/NewRelic/Agent/Instrumentation.html +174 -0
- data/rdoc/classes/NewRelic/Agent/Instrumentation/ActiveRecordInstrumentation.html +221 -0
- data/rdoc/classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation.html +349 -0
- data/rdoc/classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation/ClassMethods.html +277 -0
- data/rdoc/classes/NewRelic/Agent/Instrumentation/DelayedJobInstrumentation.html +112 -0
- data/rdoc/classes/NewRelic/Agent/Instrumentation/MetricFrame.html +1007 -0
- data/rdoc/classes/NewRelic/Agent/Instrumentation/Rack.html +321 -0
- data/rdoc/classes/NewRelic/Agent/Instrumentation/Sinatra.html +176 -0
- data/rdoc/classes/NewRelic/Agent/LicenseException.html +117 -0
- data/rdoc/classes/NewRelic/Agent/MethodTracer.html +150 -0
- data/rdoc/classes/NewRelic/Agent/MethodTracer/ClassMethods.html +295 -0
- data/rdoc/classes/NewRelic/Agent/MethodTracer/InstanceMethods.html +284 -0
- data/rdoc/classes/NewRelic/Agent/PostTooBigException.html +120 -0
- data/rdoc/classes/NewRelic/Agent/Sampler.html +314 -0
- data/rdoc/classes/NewRelic/Agent/Sampler/Unsupported.html +117 -0
- data/rdoc/classes/NewRelic/Agent/Samplers.html +126 -0
- data/rdoc/classes/NewRelic/Agent/Samplers/CpuSampler.html +327 -0
- data/rdoc/classes/NewRelic/Agent/Samplers/DelayedJobLockSampler.html +296 -0
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler.html +321 -0
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/Base.html +186 -0
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/JavaHeapSampler.html +173 -0
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/ProcStatus.html +216 -0
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/ShellPS.html +207 -0
- data/rdoc/classes/NewRelic/Agent/Samplers/ObjectSampler.html +222 -0
- data/rdoc/classes/NewRelic/Agent/ServerError.html +117 -0
- data/rdoc/classes/NewRelic/Agent/ShimAgent.html +297 -0
- data/rdoc/classes/NewRelic/Agent/StatsEngine.html +204 -0
- data/rdoc/classes/NewRelic/Agent/StatsEngine/MetricStats.html +441 -0
- data/rdoc/classes/NewRelic/Agent/StatsEngine/Samplers.html +237 -0
- data/rdoc/classes/NewRelic/Agent/StatsEngine/ScopeStackElement.html +178 -0
- data/rdoc/classes/NewRelic/Agent/StatsEngine/Transactions.html +385 -0
- data/rdoc/classes/NewRelic/Agent/TransactionSampleBuilder.html +505 -0
- data/rdoc/classes/NewRelic/Agent/TransactionSampler.html +690 -0
- data/rdoc/classes/NewRelic/Agent/WorkerLoop.html +305 -0
- data/rdoc/classes/NewRelic/Agent/WorkerLoop/LoopTask.html +224 -0
- data/rdoc/classes/NewRelic/ApdexStats.html +196 -0
- data/rdoc/classes/NewRelic/BasicStats.html +113 -0
- data/rdoc/classes/NewRelic/ChainedCall.html +180 -0
- data/rdoc/classes/NewRelic/Commands.html +112 -0
- data/rdoc/classes/NewRelic/Commands/CommandFailure.html +167 -0
- data/rdoc/classes/NewRelic/Commands/Deployments.html +285 -0
- data/rdoc/classes/NewRelic/Control.html +1760 -0
- data/rdoc/classes/NewRelic/Control/External.html +148 -0
- data/rdoc/classes/NewRelic/Control/Merb.html +227 -0
- data/rdoc/classes/NewRelic/Control/Rails.html +542 -0
- data/rdoc/classes/NewRelic/Control/Ruby.html +266 -0
- data/rdoc/classes/NewRelic/Control/Sinatra.html +178 -0
- data/rdoc/classes/NewRelic/DelayedJobInjection.html +118 -0
- data/rdoc/classes/NewRelic/Histogram.html +226 -0
- data/rdoc/classes/NewRelic/Histogram/Bucket.html +319 -0
- data/rdoc/classes/NewRelic/Histogram/Shim.html +144 -0
- data/rdoc/classes/NewRelic/LocalEnvironment.html +572 -0
- data/rdoc/classes/NewRelic/MerbBootLoader.html +146 -0
- data/rdoc/classes/NewRelic/MethodTraceStats.html +250 -0
- data/rdoc/classes/NewRelic/MetricData.html +347 -0
- data/rdoc/classes/NewRelic/MetricParser.html +747 -0
- data/rdoc/classes/NewRelic/MetricParser/ActionMailer.html +170 -0
- data/rdoc/classes/NewRelic/MetricParser/ActiveMerchant.html +267 -0
- data/rdoc/classes/NewRelic/MetricParser/ActiveRecord.html +250 -0
- data/rdoc/classes/NewRelic/MetricParser/Controller.html +363 -0
- data/rdoc/classes/NewRelic/MetricParser/ControllerCPU.html +319 -0
- data/rdoc/classes/NewRelic/MetricParser/Errors.html +170 -0
- data/rdoc/classes/NewRelic/MetricParser/External.html +339 -0
- data/rdoc/classes/NewRelic/MetricParser/MemCache.html +340 -0
- data/rdoc/classes/NewRelic/MetricParser/OtherTransaction.html +205 -0
- data/rdoc/classes/NewRelic/MetricParser/View.html +381 -0
- data/rdoc/classes/NewRelic/MetricParser/WebFrontend.html +182 -0
- data/rdoc/classes/NewRelic/MetricParser/WebService.html +172 -0
- data/rdoc/classes/NewRelic/MetricSpec.html +406 -0
- data/rdoc/classes/NewRelic/Metrics.html +138 -0
- data/rdoc/classes/NewRelic/NoticedError.html +200 -0
- data/rdoc/classes/NewRelic/Rack.html +112 -0
- data/rdoc/classes/NewRelic/Rack/MetricApp.html +193 -0
- data/rdoc/classes/NewRelic/Rack/Status.html +165 -0
- data/rdoc/classes/NewRelic/ScopedMethodTraceStats.html +225 -0
- data/rdoc/classes/NewRelic/Stats.html +917 -0
- data/rdoc/classes/NewRelic/StatsBase.html +346 -0
- data/rdoc/classes/NewRelic/TransactionAnalysis.html +269 -0
- data/rdoc/classes/NewRelic/TransactionAnalysis/SegmentSummary.html +338 -0
- data/rdoc/classes/NewRelic/TransactionSample.html +766 -0
- data/rdoc/classes/NewRelic/TransactionSample/CompositeSegment.html +195 -0
- data/rdoc/classes/NewRelic/TransactionSample/FakeSegment.html +113 -0
- data/rdoc/classes/NewRelic/TransactionSample/IDGenerator.html +178 -0
- data/rdoc/classes/NewRelic/TransactionSample/Segment.html +920 -0
- data/rdoc/classes/NewRelic/TransactionSample/SummarySegment.html +180 -0
- data/rdoc/classes/NewRelic/VersionNumber.html +338 -0
- data/rdoc/classes/NewRelicApi.html +270 -0
- data/rdoc/classes/NewRelicApi/Account.html +178 -0
- data/rdoc/classes/NewRelicApi/Account/AccountUsage.html +111 -0
- data/rdoc/classes/NewRelicApi/Account/AccountView.html +146 -0
- data/rdoc/classes/NewRelicApi/Application.html +139 -0
- data/rdoc/classes/NewRelicApi/Application/Agent.html +119 -0
- data/rdoc/classes/NewRelicApi/Deployment.html +123 -0
- data/rdoc/classes/NewRelicApi/Subscription.html +111 -0
- data/rdoc/classes/NewRelicApi/ThresholdValue.html +174 -0
- data/rdoc/classes/NewRelicApi/User.html +111 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/CHANGELOG.html +649 -0
- data/rdoc/files/LICENSE.html +143 -0
- data/rdoc/files/lib/new_relic/agent/agent_rb.html +113 -0
- data/rdoc/files/lib/new_relic/agent/busy_calculator_rb.html +115 -0
- data/rdoc/files/lib/new_relic/agent/chained_call_rb.html +107 -0
- data/rdoc/files/lib/new_relic/agent/collection_helper_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/error_collector_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/active_merchant_rb.html +107 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/active_record_instrumentation_rb.html +108 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/authlogic_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/controller_instrumentation_rb.html +108 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/data_mapper_rb.html +191 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/delayed_job_instrumentation_rb.html +109 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/memcache_rb.html +152 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/merb/controller_rb.html +155 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/merb/errors_rb.html +107 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/metric_frame_rb.html +113 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/net_rb.html +172 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/passenger_instrumentation_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/rack_rb.html +108 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/rails/action_controller_rb.html +152 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/rails/action_web_service_rb.html +108 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/rails/errors_rb.html +167 -0
- data/rdoc/files/lib/new_relic/agent/instrumentation/sinatra_rb.html +108 -0
- data/rdoc/files/lib/new_relic/agent/method_tracer_rb.html +108 -0
- data/rdoc/files/lib/new_relic/agent/sampler_rb.html +116 -0
- data/rdoc/files/lib/new_relic/agent/samplers/cpu_sampler_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/samplers/delayed_job_lock_sampler_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/samplers/memory_sampler_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/samplers/object_sampler_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/shim_agent_rb.html +108 -0
- data/rdoc/files/lib/new_relic/agent/stats_engine/metric_stats_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/stats_engine/samplers_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/stats_engine/transactions_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/stats_engine_rb.html +110 -0
- data/rdoc/files/lib/new_relic/agent/transaction_sampler_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent/worker_loop_rb.html +101 -0
- data/rdoc/files/lib/new_relic/agent_rb.html +204 -0
- data/rdoc/files/lib/new_relic/commands/deployments_rb.html +119 -0
- data/rdoc/files/lib/new_relic/commands/new_relic_commands_rb.html +108 -0
- data/rdoc/files/lib/new_relic/control/external_rb.html +117 -0
- data/rdoc/files/lib/new_relic/control/merb_rb.html +101 -0
- data/rdoc/files/lib/new_relic/control/rails_rb.html +108 -0
- data/rdoc/files/lib/new_relic/control/ruby_rb.html +110 -0
- data/rdoc/files/lib/new_relic/control/sinatra_rb.html +108 -0
- data/rdoc/files/lib/new_relic/control_rb.html +116 -0
- data/rdoc/files/lib/new_relic/delayed_job_injection_rb.html +180 -0
- data/rdoc/files/lib/new_relic/histogram_rb.html +114 -0
- data/rdoc/files/lib/new_relic/local_environment_rb.html +111 -0
- data/rdoc/files/lib/new_relic/merbtasks_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_data_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/action_mailer_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/active_merchant_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/active_record_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/controller_cpu_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/controller_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/errors_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/external_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/mem_cache_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/other_transaction_rb.html +108 -0
- data/rdoc/files/lib/new_relic/metric_parser/view_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser/web_frontend_rb.html +107 -0
- data/rdoc/files/lib/new_relic/metric_parser/web_service_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_parser_rb.html +101 -0
- data/rdoc/files/lib/new_relic/metric_spec_rb.html +108 -0
- data/rdoc/files/lib/new_relic/metrics_rb.html +101 -0
- data/rdoc/files/lib/new_relic/noticed_error_rb.html +107 -0
- data/rdoc/files/lib/new_relic/rack/metric_app_rb.html +108 -0
- data/rdoc/files/lib/new_relic/rack_app_rb.html +110 -0
- data/rdoc/files/lib/new_relic/recipes_rb.html +128 -0
- data/rdoc/files/lib/new_relic/stats_rb.html +101 -0
- data/rdoc/files/lib/new_relic/transaction_analysis_rb.html +108 -0
- data/rdoc/files/lib/new_relic/transaction_sample_rb.html +101 -0
- data/rdoc/files/lib/new_relic/version_rb.html +101 -0
- data/rdoc/files/lib/new_relic_api_rb.html +145 -0
- data/rdoc/files/lib/newrelic_rpm_rb.html +147 -0
- data/rdoc/files/lib/tasks/all_rb.html +107 -0
- data/rdoc/fr_class_index.html +134 -0
- data/rdoc/fr_file_index.html +103 -0
- data/rdoc/fr_method_index.html +568 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/test/new_relic/agent/active_record_instrumentation_test.rb +16 -5
- data/test/new_relic/agent/collection_helper_test.rb +1 -1
- data/test/new_relic/agent/error_collector_test.rb +2 -4
- data/test/new_relic/agent/rpm_agent_test.rb +1 -1
- data/test/new_relic/agent/task_instrumentation_test.rb +1 -1
- data/test/new_relic/agent/worker_loop_test.rb +33 -76
- data/test/new_relic/control_test.rb +9 -2
- data/test/new_relic/stats_test.rb +29 -1
- data/test/new_relic/version_number_test.rb +13 -0
- data/ui/helpers/newrelic_helper.rb +1 -2
- metadata +196 -4
@@ -0,0 +1,349 @@
|
|
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::ControllerInstrumentation</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::ControllerInstrumentation</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/controller_instrumentation_rb.html">
|
59
|
+
lib/new_relic/agent/instrumentation/controller_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
|
+
<div id="description">
|
76
|
+
<h2><a href="../../../NewRelic.html">NewRelic</a> instrumentation for controller actions and tasks</h2>
|
77
|
+
<p>
|
78
|
+
This instrumentation is applied to the action controller to collect metrics
|
79
|
+
for every web request.
|
80
|
+
</p>
|
81
|
+
<p>
|
82
|
+
It can also be used to capture performance information for background tasks
|
83
|
+
and other non-web transactions, including detailed transaction traces and
|
84
|
+
traced errors.
|
85
|
+
</p>
|
86
|
+
<p>
|
87
|
+
For details on how to instrument background tasks see <a
|
88
|
+
href="ControllerInstrumentation/ClassMethods.html#M000173">ClassMethods#add_transaction_tracer</a>
|
89
|
+
and <a
|
90
|
+
href="ControllerInstrumentation.html#M000168">perform_action_with_newrelic_trace</a>
|
91
|
+
</p>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
<div id="method-list">
|
99
|
+
<h3 class="section-bar">Methods</h3>
|
100
|
+
|
101
|
+
<div class="name-list">
|
102
|
+
<a href="#M000170">newrelic_request_headers</a>
|
103
|
+
<a href="#M000169">newrelic_response_code</a>
|
104
|
+
<a href="#M000168">perform_action_with_newrelic_trace</a>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
<!-- if includes -->
|
112
|
+
|
113
|
+
<div id="section">
|
114
|
+
|
115
|
+
<div id="class-list">
|
116
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
117
|
+
|
118
|
+
Module <a href="ControllerInstrumentation/ClassMethods.html" class="link">NewRelic::Agent::Instrumentation::ControllerInstrumentation::ClassMethods</a><br />
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<!-- if method_list -->
|
129
|
+
<div id="methods">
|
130
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
131
|
+
|
132
|
+
<div id="method-M000168" class="method-detail">
|
133
|
+
<a name="M000168"></a>
|
134
|
+
|
135
|
+
<div class="method-heading">
|
136
|
+
<a href="#M000168" class="method-signature">
|
137
|
+
<span class="method-name">perform_action_with_newrelic_trace</span><span class="method-args">(*args) {|| ...}</span>
|
138
|
+
</a>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div class="method-description">
|
142
|
+
<p>
|
143
|
+
Yield to the given block with <a href="../../../NewRelic.html">NewRelic</a>
|
144
|
+
tracing. Used by default instrumentation on controller actions in Rails and
|
145
|
+
Merb. But it can also be used in custom instrumentation of controller
|
146
|
+
methods and background tasks.
|
147
|
+
</p>
|
148
|
+
<p>
|
149
|
+
This is the method invoked by instrumentation added by the <tt><a
|
150
|
+
href="ControllerInstrumentation/ClassMethods.html#M000173">ClassMethods#add_transaction_tracer</a></tt>.
|
151
|
+
</p>
|
152
|
+
<p>
|
153
|
+
Here‘s a more verbose version of the example shown in <tt><a
|
154
|
+
href="ControllerInstrumentation/ClassMethods.html#M000173">ClassMethods#add_transaction_tracer</a></tt>
|
155
|
+
using this method instead of add_transaction_tracer.
|
156
|
+
</p>
|
157
|
+
<p>
|
158
|
+
Below is a controller with an <tt>invoke_operation</tt> action which
|
159
|
+
dispatches to more specific operation methods based on a parameter (very
|
160
|
+
dangerous, btw!). With this instrumentation, the <tt>invoke_operation</tt>
|
161
|
+
action is ignored but the operation methods show up in RPM as if they were
|
162
|
+
first class controller actions
|
163
|
+
</p>
|
164
|
+
<pre>
|
165
|
+
MyController < ActionController::Base
|
166
|
+
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
167
|
+
# dispatch the given op to the method given by the service parameter.
|
168
|
+
def invoke_operation
|
169
|
+
op = params['operation']
|
170
|
+
perform_action_with_newrelic_trace(:name => op) do
|
171
|
+
send op, params['message']
|
172
|
+
end
|
173
|
+
end
|
174
|
+
# Ignore the invoker to avoid double counting
|
175
|
+
newrelic_ignore :only => 'invoke_operation'
|
176
|
+
end
|
177
|
+
</pre>
|
178
|
+
<p>
|
179
|
+
When invoking this method explicitly as in the example above, pass in a
|
180
|
+
block to measure with some combination of options:
|
181
|
+
</p>
|
182
|
+
<ul>
|
183
|
+
<li><tt>:category => :controller</tt> indicates that this is a controller
|
184
|
+
action and will appear with all the other actions. This is the default.
|
185
|
+
|
186
|
+
</li>
|
187
|
+
<li><tt>:category => :task</tt> indicates that this is a background task and
|
188
|
+
will show up in RPM with other background tasks instead of in the
|
189
|
+
controllers list
|
190
|
+
|
191
|
+
</li>
|
192
|
+
<li><tt>:category => :rack</tt> if you are instrumenting a rack middleware
|
193
|
+
call. The <tt>:name</tt> is optional, useful if you have more than one
|
194
|
+
potential transaction in the call.
|
195
|
+
|
196
|
+
</li>
|
197
|
+
<li><tt>:category => :uri</tt> indicates that this is a web transaction
|
198
|
+
whose name is a normalized URI, where ‘normalized’ means the
|
199
|
+
URI does not have any elements with data in them such as in many REST URIs.
|
200
|
+
|
201
|
+
</li>
|
202
|
+
<li><tt>:name => action_name</tt> is used to specify the action name used as
|
203
|
+
part of the metric name
|
204
|
+
|
205
|
+
</li>
|
206
|
+
<li><tt>:params => {…}</tt> to provide information about the context
|
207
|
+
of the call, used in transaction trace display, for example: <tt>:params
|
208
|
+
=> { :account => @account.name, :file => file.name }</tt> These
|
209
|
+
are treated similarly to request parameters in web transactions.
|
210
|
+
|
211
|
+
</li>
|
212
|
+
</ul>
|
213
|
+
<p>
|
214
|
+
Seldomly used options:
|
215
|
+
</p>
|
216
|
+
<ul>
|
217
|
+
<li><tt>:force => true</tt> indicates you should capture all metrics even if
|
218
|
+
the newrelic_ignore directive was specified
|
219
|
+
|
220
|
+
</li>
|
221
|
+
<li><tt>:class_name => aClass.name</tt> is used to override the name of the
|
222
|
+
class when used inside the metric name. Default is the current class.
|
223
|
+
|
224
|
+
</li>
|
225
|
+
<li><tt>:path => metric_path</tt> is <b>deprecated</b> in the public API. It
|
226
|
+
allows you to set the entire metric after the category part. Overrides all
|
227
|
+
the other options.
|
228
|
+
|
229
|
+
</li>
|
230
|
+
<li><tt>:request => Rack::Request#new(env)</tt> is used to pass in a request
|
231
|
+
object that may respond to uri and referer.
|
232
|
+
|
233
|
+
</li>
|
234
|
+
</ul>
|
235
|
+
<p>
|
236
|
+
If a single argument is passed in, it is treated as a metric path. This
|
237
|
+
form is deprecated.
|
238
|
+
</p>
|
239
|
+
<p><a class="source-toggle" href="#"
|
240
|
+
onclick="toggleCode('M000168-source');return false;">[Source]</a></p>
|
241
|
+
<div class="method-source-code" id="M000168-source">
|
242
|
+
<pre>
|
243
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/controller_instrumentation.rb, line 232</span>
|
244
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">perform_action_with_newrelic_trace</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
245
|
+
|
246
|
+
<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">ensure_worker_thread_started</span>
|
247
|
+
|
248
|
+
<span class="ruby-comment cmt"># Skip instrumentation based on the value of 'do_not_trace' and if </span>
|
249
|
+
<span class="ruby-comment cmt"># we aren't calling directly with a block.</span>
|
250
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">block_given?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">_is_filtered?</span>(<span class="ruby-value str">'do_not_trace'</span>)
|
251
|
+
<span class="ruby-comment cmt"># Also ignore all instrumentation in the call sequence</span>
|
252
|
+
<span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">disable_all_tracing</span> <span class="ruby-keyword kw">do</span>
|
253
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">perform_action_without_newrelic_trace</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
254
|
+
<span class="ruby-keyword kw">end</span>
|
255
|
+
<span class="ruby-keyword kw">end</span>
|
256
|
+
|
257
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">perform_action_with_newrelic_profile</span>(<span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</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">profiling?</span>
|
258
|
+
|
259
|
+
<span class="ruby-identifier">frame_data</span> = <span class="ruby-identifier">_push_metric_frame</span>(<span class="ruby-identifier">block_given?</span> <span class="ruby-value">? </span><span class="ruby-identifier">args</span> <span class="ruby-operator">:</span> [])
|
260
|
+
<span class="ruby-keyword kw">begin</span>
|
261
|
+
<span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Agent</span>.<span class="ruby-identifier">trace_execution_scoped</span> <span class="ruby-identifier">frame_data</span>.<span class="ruby-identifier">recorded_metrics</span>, <span class="ruby-identifier">:force</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">frame_data</span>.<span class="ruby-identifier">force_flag</span> <span class="ruby-keyword kw">do</span>
|
262
|
+
<span class="ruby-identifier">frame_data</span>.<span class="ruby-identifier">start_transaction</span>
|
263
|
+
<span class="ruby-keyword kw">begin</span>
|
264
|
+
<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">BusyCalculator</span>.<span class="ruby-identifier">dispatcher_start</span> <span class="ruby-identifier">frame_data</span>.<span class="ruby-identifier">start</span>
|
265
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
266
|
+
<span class="ruby-keyword kw">yield</span>
|
267
|
+
<span class="ruby-keyword kw">else</span>
|
268
|
+
<span class="ruby-identifier">perform_action_without_newrelic_trace</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
269
|
+
<span class="ruby-keyword kw">end</span>
|
270
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
271
|
+
<span class="ruby-identifier">frame_data</span>.<span class="ruby-identifier">notice_error</span>(<span class="ruby-identifier">e</span>)
|
272
|
+
<span class="ruby-identifier">raise</span>
|
273
|
+
<span class="ruby-keyword kw">end</span>
|
274
|
+
<span class="ruby-keyword kw">end</span>
|
275
|
+
<span class="ruby-keyword kw">ensure</span>
|
276
|
+
<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">BusyCalculator</span>.<span class="ruby-identifier">dispatcher_finish</span>
|
277
|
+
<span class="ruby-comment cmt"># Look for a metric frame in the thread local and process it.</span>
|
278
|
+
<span class="ruby-comment cmt"># Clear the thread local when finished to ensure it only gets called once.</span>
|
279
|
+
<span class="ruby-identifier">frame_data</span>.<span class="ruby-identifier">record_apdex</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">_is_filtered?</span>(<span class="ruby-value str">'ignore_apdex'</span>)
|
280
|
+
<span class="ruby-identifier">frame_data</span>.<span class="ruby-identifier">pop</span>
|
281
|
+
<span class="ruby-keyword kw">end</span>
|
282
|
+
<span class="ruby-keyword kw">end</span>
|
283
|
+
</pre>
|
284
|
+
</div>
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<h3 class="section-bar">Protected Instance methods</h3>
|
289
|
+
|
290
|
+
<div id="method-M000170" class="method-detail">
|
291
|
+
<a name="M000170"></a>
|
292
|
+
|
293
|
+
<div class="method-heading">
|
294
|
+
<a href="#M000170" class="method-signature">
|
295
|
+
<span class="method-name">newrelic_request_headers</span><span class="method-args">()</span>
|
296
|
+
</a>
|
297
|
+
</div>
|
298
|
+
|
299
|
+
<div class="method-description">
|
300
|
+
<p><a class="source-toggle" href="#"
|
301
|
+
onclick="toggleCode('M000170-source');return false;">[Source]</a></p>
|
302
|
+
<div class="method-source-code" id="M000170-source">
|
303
|
+
<pre>
|
304
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/controller_instrumentation.rb, line 276</span>
|
305
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">newrelic_request_headers</span>
|
306
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:request</span>) <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:headers</span>) <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">headers</span>
|
307
|
+
<span class="ruby-keyword kw">end</span>
|
308
|
+
</pre>
|
309
|
+
</div>
|
310
|
+
</div>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
<div id="method-M000169" class="method-detail">
|
314
|
+
<a name="M000169"></a>
|
315
|
+
|
316
|
+
<div class="method-heading">
|
317
|
+
<a href="#M000169" class="method-signature">
|
318
|
+
<span class="method-name">newrelic_response_code</span><span class="method-args">()</span>
|
319
|
+
</a>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
<div class="method-description">
|
323
|
+
<p>
|
324
|
+
Should be implemented in the dispatcher class
|
325
|
+
</p>
|
326
|
+
<p><a class="source-toggle" href="#"
|
327
|
+
onclick="toggleCode('M000169-source');return false;">[Source]</a></p>
|
328
|
+
<div class="method-source-code" id="M000169-source">
|
329
|
+
<pre>
|
330
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/controller_instrumentation.rb, line 274</span>
|
331
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">newrelic_response_code</span>; <span class="ruby-keyword kw">end</span>
|
332
|
+
</pre>
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
</div>
|
339
|
+
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
<div id="validator-badges">
|
345
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
346
|
+
</div>
|
347
|
+
|
348
|
+
</body>
|
349
|
+
</html>
|
@@ -0,0 +1,277 @@
|
|
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::ControllerInstrumentation::ClassMethods</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::ControllerInstrumentation::ClassMethods</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/controller_instrumentation_rb.html">
|
59
|
+
lib/new_relic/agent/instrumentation/controller_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
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000173">add_transaction_tracer</a>
|
84
|
+
<a href="#M000171">newrelic_ignore</a>
|
85
|
+
<a href="#M000172">newrelic_ignore_apdex</a>
|
86
|
+
</div>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
<!-- if includes -->
|
93
|
+
|
94
|
+
<div id="section">
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if method_list -->
|
104
|
+
<div id="methods">
|
105
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
106
|
+
|
107
|
+
<div id="method-M000173" class="method-detail">
|
108
|
+
<a name="M000173"></a>
|
109
|
+
|
110
|
+
<div class="method-heading">
|
111
|
+
<a href="#M000173" class="method-signature">
|
112
|
+
<span class="method-name">add_transaction_tracer</span><span class="method-args">(method, options={})</span>
|
113
|
+
</a>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div class="method-description">
|
117
|
+
<p>
|
118
|
+
Add transaction tracing to the given method. This will treat the given
|
119
|
+
method as a main entrypoint for instrumentation, just like controller
|
120
|
+
actions are treated by default. Useful especially for background tasks.
|
121
|
+
</p>
|
122
|
+
<p>
|
123
|
+
Example for background job:
|
124
|
+
</p>
|
125
|
+
<pre>
|
126
|
+
class Job
|
127
|
+
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
128
|
+
def run(task)
|
129
|
+
...
|
130
|
+
end
|
131
|
+
# Instrument run so tasks show up under task.name. Note single
|
132
|
+
# quoting to defer eval to runtime.
|
133
|
+
add_transaction_tracer :run, :name => '#{args[0].name}'
|
134
|
+
end
|
135
|
+
</pre>
|
136
|
+
<p>
|
137
|
+
Here‘s an example of a controller that uses a dispatcher action to
|
138
|
+
invoke operations which you want treated as top level actions, so they
|
139
|
+
aren‘t all lumped into the invoker action.
|
140
|
+
</p>
|
141
|
+
<pre>
|
142
|
+
MyController < ActionController::Base
|
143
|
+
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
144
|
+
# dispatch the given op to the method given by the service parameter.
|
145
|
+
def invoke_operation
|
146
|
+
op = params['operation']
|
147
|
+
send op
|
148
|
+
end
|
149
|
+
# Ignore the invoker to avoid double counting
|
150
|
+
newrelic_ignore :only => 'invoke_operation'
|
151
|
+
# Instrument the operations:
|
152
|
+
add_transaction_tracer :print
|
153
|
+
add_transaction_tracer :show
|
154
|
+
add_transaction_tracer :forward
|
155
|
+
end
|
156
|
+
</pre>
|
157
|
+
<p>
|
158
|
+
Here‘s an example of how to pass contextual information into the
|
159
|
+
transaction so it will appear in transaction traces:
|
160
|
+
</p>
|
161
|
+
<pre>
|
162
|
+
class Job
|
163
|
+
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
164
|
+
def process(account)
|
165
|
+
...
|
166
|
+
end
|
167
|
+
# Include the account name in the transaction details. Note the single
|
168
|
+
# quotes to defer eval until call time.
|
169
|
+
add_transaction_tracer :process, :params => '{ :account_name => args[0].name }'
|
170
|
+
end
|
171
|
+
</pre>
|
172
|
+
<p>
|
173
|
+
See <a
|
174
|
+
href="../ControllerInstrumentation.html#M000168">NewRelic::Agent::Instrumentation::ControllerInstrumentation#perform_action_with_newrelic_trace</a>
|
175
|
+
for the full list of available options.
|
176
|
+
</p>
|
177
|
+
<p><a class="source-toggle" href="#"
|
178
|
+
onclick="toggleCode('M000173-source');return false;">[Source]</a></p>
|
179
|
+
<div class="method-source-code" id="M000173-source">
|
180
|
+
<pre>
|
181
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/controller_instrumentation.rb, line 124</span>
|
182
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_transaction_tracer</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span>={})
|
183
|
+
<span class="ruby-comment cmt"># The metric path:</span>
|
184
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:name</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_s</span>
|
185
|
+
<span class="ruby-comment cmt"># create the argument list:</span>
|
186
|
+
<span class="ruby-identifier">options_arg</span> = []
|
187
|
+
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
188
|
+
<span class="ruby-identifier">valuestr</span> = <span class="ruby-keyword kw">case</span>
|
189
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
|
190
|
+
<span class="ruby-identifier">value</span>.<span class="ruby-identifier">inspect</span>
|
191
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:params</span>
|
192
|
+
<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>
|
193
|
+
<span class="ruby-keyword kw">else</span>
|
194
|
+
<span class="ruby-node">%Q["#{value.to_s}"]</span>
|
195
|
+
<span class="ruby-keyword kw">end</span>
|
196
|
+
<span class="ruby-identifier">options_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-node">%Q[:#{key} => #{valuestr}]</span>
|
197
|
+
<span class="ruby-keyword kw">end</span>
|
198
|
+
<span class="ruby-identifier">class_eval</span> <span class="ruby-value str">"def \#{method.to_s}_with_newrelic_transaction_trace(*args, &block)\nperform_action_with_newrelic_trace(\#{options_arg.join(',')}) do\n\#{method.to_s}_without_newrelic_transaction_trace(*args, &block)\nend\nend\n"</span>
|
199
|
+
<span class="ruby-identifier">alias_method</span> <span class="ruby-node">"#{method.to_s}_without_newrelic_transaction_trace"</span>, <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_s</span>
|
200
|
+
<span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-node">"#{method.to_s}_with_newrelic_transaction_trace"</span>
|
201
|
+
<span class="ruby-keyword kw">end</span>
|
202
|
+
</pre>
|
203
|
+
</div>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div id="method-M000171" class="method-detail">
|
208
|
+
<a name="M000171"></a>
|
209
|
+
|
210
|
+
<div class="method-heading">
|
211
|
+
<a href="#M000171" class="method-signature">
|
212
|
+
<span class="method-name">newrelic_ignore</span><span class="method-args">(specifiers={})</span>
|
213
|
+
</a>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div class="method-description">
|
217
|
+
<p>
|
218
|
+
Have <a href="../../../../NewRelic.html">NewRelic</a> ignore actions in
|
219
|
+
this controller. Specify the actions as hash options using :except and
|
220
|
+
:only. If no actions are specified, all actions are ignored.
|
221
|
+
</p>
|
222
|
+
<p><a class="source-toggle" href="#"
|
223
|
+
onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
|
224
|
+
<div class="method-source-code" id="M000171-source">
|
225
|
+
<pre>
|
226
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/controller_instrumentation.rb, line 43</span>
|
227
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">newrelic_ignore</span>(<span class="ruby-identifier">specifiers</span>={})
|
228
|
+
<span class="ruby-identifier">newrelic_ignore_aspect</span>(<span class="ruby-value str">'do_not_trace'</span>, <span class="ruby-identifier">specifiers</span>)
|
229
|
+
<span class="ruby-keyword kw">end</span>
|
230
|
+
</pre>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div id="method-M000172" class="method-detail">
|
236
|
+
<a name="M000172"></a>
|
237
|
+
|
238
|
+
<div class="method-heading">
|
239
|
+
<a href="#M000172" class="method-signature">
|
240
|
+
<span class="method-name">newrelic_ignore_apdex</span><span class="method-args">(specifiers={})</span>
|
241
|
+
</a>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
<div class="method-description">
|
245
|
+
<p>
|
246
|
+
Have <a href="../../../../NewRelic.html">NewRelic</a> omit apdex
|
247
|
+
measurements on the given actions. Typically used for actions that are not
|
248
|
+
user facing or that skew your overall apdex measurement. Accepts :except
|
249
|
+
and :only options, as with <a
|
250
|
+
href="ClassMethods.html#M000171">newrelic_ignore</a>.
|
251
|
+
</p>
|
252
|
+
<p><a class="source-toggle" href="#"
|
253
|
+
onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
|
254
|
+
<div class="method-source-code" id="M000172-source">
|
255
|
+
<pre>
|
256
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/controller_instrumentation.rb, line 49</span>
|
257
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">newrelic_ignore_apdex</span>(<span class="ruby-identifier">specifiers</span>={})
|
258
|
+
<span class="ruby-identifier">newrelic_ignore_aspect</span>(<span class="ruby-value str">'ignore_apdex'</span>, <span class="ruby-identifier">specifiers</span>)
|
259
|
+
<span class="ruby-keyword kw">end</span>
|
260
|
+
</pre>
|
261
|
+
</div>
|
262
|
+
</div>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
|
266
|
+
</div>
|
267
|
+
|
268
|
+
|
269
|
+
</div>
|
270
|
+
|
271
|
+
|
272
|
+
<div id="validator-badges">
|
273
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
274
|
+
</div>
|
275
|
+
|
276
|
+
</body>
|
277
|
+
</html>
|