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,690 @@
|
|
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::TransactionSampler</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::TransactionSampler</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/transaction_sampler_rb.html">
|
59
|
+
lib/new_relic/agent/transaction_sampler.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="#M000285">current_sample_id</a>
|
90
|
+
<a href="#M000286">disable</a>
|
91
|
+
<a href="#M000298">harvest</a>
|
92
|
+
<a href="#M000294">ignore_transaction</a>
|
93
|
+
<a href="#M000284">new</a>
|
94
|
+
<a href="#M000288">notice_first_scope_push</a>
|
95
|
+
<a href="#M000291">notice_pop_scope</a>
|
96
|
+
<a href="#M000295">notice_profile</a>
|
97
|
+
<a href="#M000289">notice_push_scope</a>
|
98
|
+
<a href="#M000292">notice_scope_empty</a>
|
99
|
+
<a href="#M000297">notice_sql</a>
|
100
|
+
<a href="#M000293">notice_transaction</a>
|
101
|
+
<a href="#M000296">notice_transaction_cpu_time</a>
|
102
|
+
<a href="#M000299">reset!</a>
|
103
|
+
<a href="#M000287">sampling_rate=</a>
|
104
|
+
<a href="#M000290">scope_depth</a>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
<!-- if includes -->
|
112
|
+
|
113
|
+
<div id="section">
|
114
|
+
|
115
|
+
|
116
|
+
<div id="constants-list">
|
117
|
+
<h3 class="section-bar">Constants</h3>
|
118
|
+
|
119
|
+
<div class="name-list">
|
120
|
+
<table summary="Constants">
|
121
|
+
<tr class="top-aligned-row context-row">
|
122
|
+
<td class="context-item-name">BUILDER_KEY</td>
|
123
|
+
<td>=</td>
|
124
|
+
<td class="context-item-value">:transaction_sample_builder</td>
|
125
|
+
</tr>
|
126
|
+
<tr class="top-aligned-row context-row">
|
127
|
+
<td class="context-item-name">MAX_SQL_LENGTH</td>
|
128
|
+
<td>=</td>
|
129
|
+
<td class="context-item-value">16384</td>
|
130
|
+
<td width="3em"> </td>
|
131
|
+
<td class="context-item-desc">
|
132
|
+
some statements (particularly INSERTS with large BLOBS may be very large;
|
133
|
+
we should trim them to a maximum usable length config is the driver
|
134
|
+
configuration for the connection
|
135
|
+
|
136
|
+
</td>
|
137
|
+
</tr>
|
138
|
+
</table>
|
139
|
+
</div>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<div id="attribute-list">
|
145
|
+
<h3 class="section-bar">Attributes</h3>
|
146
|
+
|
147
|
+
<div class="name-list">
|
148
|
+
<table>
|
149
|
+
<tr class="top-aligned-row context-row">
|
150
|
+
<td class="context-item-name">disabled</td>
|
151
|
+
<td class="context-item-value"> [R] </td>
|
152
|
+
<td class="context-item-desc"></td>
|
153
|
+
</tr>
|
154
|
+
<tr class="top-aligned-row context-row">
|
155
|
+
<td class="context-item-name">last_sample</td>
|
156
|
+
<td class="context-item-value"> [R] </td>
|
157
|
+
<td class="context-item-desc"></td>
|
158
|
+
</tr>
|
159
|
+
<tr class="top-aligned-row context-row">
|
160
|
+
<td class="context-item-name">random_sampling</td>
|
161
|
+
<td class="context-item-value"> [RW] </td>
|
162
|
+
<td class="context-item-desc"></td>
|
163
|
+
</tr>
|
164
|
+
<tr class="top-aligned-row context-row">
|
165
|
+
<td class="context-item-name">samples</td>
|
166
|
+
<td class="context-item-value"> [R] </td>
|
167
|
+
<td class="context-item-desc"></td>
|
168
|
+
</tr>
|
169
|
+
<tr class="top-aligned-row context-row">
|
170
|
+
<td class="context-item-name">sampling_rate</td>
|
171
|
+
<td class="context-item-value"> [RW] </td>
|
172
|
+
<td class="context-item-desc"></td>
|
173
|
+
</tr>
|
174
|
+
<tr class="top-aligned-row context-row">
|
175
|
+
<td class="context-item-name">stack_trace_threshold</td>
|
176
|
+
<td class="context-item-value"> [RW] </td>
|
177
|
+
<td class="context-item-desc"></td>
|
178
|
+
</tr>
|
179
|
+
</table>
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<!-- if method_list -->
|
186
|
+
<div id="methods">
|
187
|
+
<h3 class="section-bar">Public Class methods</h3>
|
188
|
+
|
189
|
+
<div id="method-M000284" class="method-detail">
|
190
|
+
<a name="M000284"></a>
|
191
|
+
|
192
|
+
<div class="method-heading">
|
193
|
+
<a href="#M000284" class="method-signature">
|
194
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
195
|
+
</a>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div class="method-description">
|
199
|
+
<p><a class="source-toggle" href="#"
|
200
|
+
onclick="toggleCode('M000284-source');return false;">[Source]</a></p>
|
201
|
+
<div class="method-source-code" id="M000284-source">
|
202
|
+
<pre>
|
203
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 19</span>
|
204
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
205
|
+
<span class="ruby-ivar">@samples</span> = []
|
206
|
+
<span class="ruby-ivar">@harvest_count</span> = <span class="ruby-value">0</span>
|
207
|
+
<span class="ruby-ivar">@max_samples</span> = <span class="ruby-value">100</span>
|
208
|
+
<span class="ruby-ivar">@random_sample</span> = <span class="ruby-keyword kw">nil</span>
|
209
|
+
<span class="ruby-identifier">config</span> = <span class="ruby-constant">NewRelic</span><span class="ruby-operator">::</span><span class="ruby-constant">Control</span>.<span class="ruby-identifier">instance</span>
|
210
|
+
<span class="ruby-identifier">sampler_config</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'transaction_tracer'</span>, {})
|
211
|
+
<span class="ruby-ivar">@segment_limit</span> = <span class="ruby-identifier">sampler_config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'limit_segments'</span>, <span class="ruby-value">4000</span>)
|
212
|
+
<span class="ruby-ivar">@stack_trace_threshold</span> = <span class="ruby-identifier">sampler_config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'stack_trace_threshold'</span>, <span class="ruby-value">0</span><span class="ruby-value">.500</span>).<span class="ruby-identifier">to_f</span>
|
213
|
+
<span class="ruby-ivar">@samples_lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
214
|
+
<span class="ruby-keyword kw">end</span>
|
215
|
+
</pre>
|
216
|
+
</div>
|
217
|
+
</div>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
221
|
+
|
222
|
+
<div id="method-M000285" class="method-detail">
|
223
|
+
<a name="M000285"></a>
|
224
|
+
|
225
|
+
<div class="method-heading">
|
226
|
+
<a href="#M000285" class="method-signature">
|
227
|
+
<span class="method-name">current_sample_id</span><span class="method-args">()</span>
|
228
|
+
</a>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div class="method-description">
|
232
|
+
<p><a class="source-toggle" href="#"
|
233
|
+
onclick="toggleCode('M000285-source');return false;">[Source]</a></p>
|
234
|
+
<div class="method-source-code" id="M000285-source">
|
235
|
+
<pre>
|
236
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 31</span>
|
237
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_sample_id</span>
|
238
|
+
<span class="ruby-identifier">b</span>=<span class="ruby-identifier">builder</span>
|
239
|
+
<span class="ruby-identifier">b</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">sample_id</span>
|
240
|
+
<span class="ruby-keyword kw">end</span>
|
241
|
+
</pre>
|
242
|
+
</div>
|
243
|
+
</div>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
<div id="method-M000286" class="method-detail">
|
247
|
+
<a name="M000286"></a>
|
248
|
+
|
249
|
+
<div class="method-heading">
|
250
|
+
<a href="#M000286" class="method-signature">
|
251
|
+
<span class="method-name">disable</span><span class="method-args">()</span>
|
252
|
+
</a>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
<div class="method-description">
|
256
|
+
<p><a class="source-toggle" href="#"
|
257
|
+
onclick="toggleCode('M000286-source');return false;">[Source]</a></p>
|
258
|
+
<div class="method-source-code" id="M000286-source">
|
259
|
+
<pre>
|
260
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 36</span>
|
261
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disable</span>
|
262
|
+
<span class="ruby-ivar">@disabled</span> = <span class="ruby-keyword kw">true</span>
|
263
|
+
<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">remove_transaction_sampler</span> <span class="ruby-keyword kw">self</span>
|
264
|
+
<span class="ruby-keyword kw">end</span>
|
265
|
+
</pre>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
<div id="method-M000298" class="method-detail">
|
271
|
+
<a name="M000298"></a>
|
272
|
+
|
273
|
+
<div class="method-heading">
|
274
|
+
<a href="#M000298" class="method-signature">
|
275
|
+
<span class="method-name">harvest</span><span class="method-args">(previous = nil, slow_threshold = 2.0)</span>
|
276
|
+
</a>
|
277
|
+
</div>
|
278
|
+
|
279
|
+
<div class="method-description">
|
280
|
+
<p>
|
281
|
+
get the set of collected samples, merging into previous samples, and clear
|
282
|
+
the collected sample list.
|
283
|
+
</p>
|
284
|
+
<p><a class="source-toggle" href="#"
|
285
|
+
onclick="toggleCode('M000298-source');return false;">[Source]</a></p>
|
286
|
+
<div class="method-source-code" id="M000298-source">
|
287
|
+
<pre>
|
288
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 155</span>
|
289
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">harvest</span>(<span class="ruby-identifier">previous</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">slow_threshold</span> = <span class="ruby-value">2.0</span>)
|
290
|
+
<span class="ruby-keyword kw">return</span> [] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">disabled</span>
|
291
|
+
<span class="ruby-identifier">result</span> = []
|
292
|
+
<span class="ruby-identifier">previous</span> <span class="ruby-operator">||=</span> []
|
293
|
+
|
294
|
+
<span class="ruby-identifier">previous</span> = [<span class="ruby-identifier">previous</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">previous</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
295
|
+
|
296
|
+
<span class="ruby-identifier">previous_slowest</span> = <span class="ruby-identifier">previous</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-keyword kw">nil</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">ts</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">a</span>) <span class="ruby-operator">?</span> ((<span class="ruby-identifier">a</span>.<span class="ruby-identifier">duration</span> <span class="ruby-operator">></span> <span class="ruby-identifier">ts</span>.<span class="ruby-identifier">duration</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">ts</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">ts</span>}
|
297
|
+
|
298
|
+
<span class="ruby-ivar">@samples_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
299
|
+
|
300
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@random_sampling</span>
|
301
|
+
<span class="ruby-ivar">@harvest_count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
302
|
+
|
303
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@harvest_count</span> <span class="ruby-operator">%</span> <span class="ruby-ivar">@sampling_rate</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
304
|
+
<span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@random_sample</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@random_sample</span>
|
305
|
+
<span class="ruby-keyword kw">else</span>
|
306
|
+
<span class="ruby-ivar">@random_sample</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># if we don't nil this out, then we won't send the slowest if slowest == @random_sample</span>
|
307
|
+
<span class="ruby-keyword kw">end</span>
|
308
|
+
<span class="ruby-keyword kw">end</span>
|
309
|
+
|
310
|
+
<span class="ruby-identifier">slowest</span> = <span class="ruby-ivar">@slowest_sample</span>
|
311
|
+
<span class="ruby-ivar">@slowest_sample</span> = <span class="ruby-keyword kw">nil</span>
|
312
|
+
|
313
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">slowest</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">slowest</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@random_sample</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">slowest</span>.<span class="ruby-identifier">duration</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">slow_threshold</span>
|
314
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">previous_slowest</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">previous_slowest</span>.<span class="ruby-identifier">duration</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">slowest</span>.<span class="ruby-identifier">duration</span>
|
315
|
+
<span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">slowest</span>
|
316
|
+
<span class="ruby-keyword kw">else</span>
|
317
|
+
<span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">previous_slowest</span>
|
318
|
+
<span class="ruby-keyword kw">end</span>
|
319
|
+
<span class="ruby-keyword kw">end</span>
|
320
|
+
|
321
|
+
<span class="ruby-ivar">@random_sample</span> = <span class="ruby-keyword kw">nil</span>
|
322
|
+
<span class="ruby-ivar">@last_sample</span> = <span class="ruby-keyword kw">nil</span>
|
323
|
+
<span class="ruby-keyword kw">end</span>
|
324
|
+
<span class="ruby-comment cmt"># Truncate the samples at 2100 segments. The UI will clamp them at 2000 segments anyway.</span>
|
325
|
+
<span class="ruby-comment cmt"># This will save us memory and bandwidth.</span>
|
326
|
+
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">sample</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sample</span>.<span class="ruby-identifier">truncate</span>(<span class="ruby-ivar">@segment_limit</span>) }
|
327
|
+
<span class="ruby-identifier">result</span>
|
328
|
+
<span class="ruby-keyword kw">end</span>
|
329
|
+
</pre>
|
330
|
+
</div>
|
331
|
+
</div>
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<div id="method-M000294" class="method-detail">
|
335
|
+
<a name="M000294"></a>
|
336
|
+
|
337
|
+
<div class="method-heading">
|
338
|
+
<a href="#M000294" class="method-signature">
|
339
|
+
<span class="method-name">ignore_transaction</span><span class="method-args">()</span>
|
340
|
+
</a>
|
341
|
+
</div>
|
342
|
+
|
343
|
+
<div class="method-description">
|
344
|
+
<p><a class="source-toggle" href="#"
|
345
|
+
onclick="toggleCode('M000294-source');return false;">[Source]</a></p>
|
346
|
+
<div class="method-source-code" id="M000294-source">
|
347
|
+
<pre>
|
348
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 116</span>
|
349
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ignore_transaction</span>
|
350
|
+
<span class="ruby-identifier">builder</span>.<span class="ruby-identifier">ignore_transaction</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">builder</span>
|
351
|
+
<span class="ruby-keyword kw">end</span>
|
352
|
+
</pre>
|
353
|
+
</div>
|
354
|
+
</div>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
<div id="method-M000288" class="method-detail">
|
358
|
+
<a name="M000288"></a>
|
359
|
+
|
360
|
+
<div class="method-heading">
|
361
|
+
<a href="#M000288" class="method-signature">
|
362
|
+
<span class="method-name">notice_first_scope_push</span><span class="method-args">(time)</span>
|
363
|
+
</a>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
<div class="method-description">
|
367
|
+
<p><a class="source-toggle" href="#"
|
368
|
+
onclick="toggleCode('M000288-source');return false;">[Source]</a></p>
|
369
|
+
<div class="method-source-code" id="M000288-source">
|
370
|
+
<pre>
|
371
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 46</span>
|
372
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notice_first_scope_push</span>(<span class="ruby-identifier">time</span>)
|
373
|
+
<span class="ruby-identifier">start_builder</span>(<span class="ruby-identifier">time</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">disabled</span>
|
374
|
+
<span class="ruby-keyword kw">end</span>
|
375
|
+
</pre>
|
376
|
+
</div>
|
377
|
+
</div>
|
378
|
+
</div>
|
379
|
+
|
380
|
+
<div id="method-M000291" class="method-detail">
|
381
|
+
<a name="M000291"></a>
|
382
|
+
|
383
|
+
<div class="method-heading">
|
384
|
+
<a href="#M000291" class="method-signature">
|
385
|
+
<span class="method-name">notice_pop_scope</span><span class="method-args">(scope, time = Time.now.to_f)</span>
|
386
|
+
</a>
|
387
|
+
</div>
|
388
|
+
|
389
|
+
<div class="method-description">
|
390
|
+
<p><a class="source-toggle" href="#"
|
391
|
+
onclick="toggleCode('M000291-source');return false;">[Source]</a></p>
|
392
|
+
<div class="method-source-code" id="M000291-source">
|
393
|
+
<pre>
|
394
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 80</span>
|
395
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notice_pop_scope</span>(<span class="ruby-identifier">scope</span>, <span class="ruby-identifier">time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>)
|
396
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">builder</span>
|
397
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"frozen already???"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">sample</span>.<span class="ruby-identifier">frozen?</span>
|
398
|
+
<span class="ruby-identifier">builder</span>.<span class="ruby-identifier">trace_exit</span>(<span class="ruby-identifier">scope</span>, <span class="ruby-identifier">time</span>)
|
399
|
+
<span class="ruby-keyword kw">end</span>
|
400
|
+
</pre>
|
401
|
+
</div>
|
402
|
+
</div>
|
403
|
+
</div>
|
404
|
+
|
405
|
+
<div id="method-M000295" class="method-detail">
|
406
|
+
<a name="M000295"></a>
|
407
|
+
|
408
|
+
<div class="method-heading">
|
409
|
+
<a href="#M000295" class="method-signature">
|
410
|
+
<span class="method-name">notice_profile</span><span class="method-args">(profile)</span>
|
411
|
+
</a>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
<div class="method-description">
|
415
|
+
<p><a class="source-toggle" href="#"
|
416
|
+
onclick="toggleCode('M000295-source');return false;">[Source]</a></p>
|
417
|
+
<div class="method-source-code" id="M000295-source">
|
418
|
+
<pre>
|
419
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 119</span>
|
420
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notice_profile</span>(<span class="ruby-identifier">profile</span>)
|
421
|
+
<span class="ruby-identifier">builder</span>.<span class="ruby-identifier">set_profile</span>(<span class="ruby-identifier">profile</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">builder</span>
|
422
|
+
<span class="ruby-keyword kw">end</span>
|
423
|
+
</pre>
|
424
|
+
</div>
|
425
|
+
</div>
|
426
|
+
</div>
|
427
|
+
|
428
|
+
<div id="method-M000289" class="method-detail">
|
429
|
+
<a name="M000289"></a>
|
430
|
+
|
431
|
+
<div class="method-heading">
|
432
|
+
<a href="#M000289" class="method-signature">
|
433
|
+
<span class="method-name">notice_push_scope</span><span class="method-args">(scope, time=Time.now.to_f)</span>
|
434
|
+
</a>
|
435
|
+
</div>
|
436
|
+
|
437
|
+
<div class="method-description">
|
438
|
+
<p><a class="source-toggle" href="#"
|
439
|
+
onclick="toggleCode('M000289-source');return false;">[Source]</a></p>
|
440
|
+
<div class="method-source-code" id="M000289-source">
|
441
|
+
<pre>
|
442
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 50</span>
|
443
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notice_push_scope</span>(<span class="ruby-identifier">scope</span>, <span class="ruby-identifier">time</span>=<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>)
|
444
|
+
|
445
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">builder</span>
|
446
|
+
|
447
|
+
<span class="ruby-identifier">builder</span>.<span class="ruby-identifier">trace_entry</span>(<span class="ruby-identifier">scope</span>, <span class="ruby-identifier">time</span>)
|
448
|
+
|
449
|
+
<span class="ruby-comment cmt"># in developer mode, capture the stack trace with the segment.</span>
|
450
|
+
<span class="ruby-comment cmt"># this is cpu and memory expensive and therefore should not be</span>
|
451
|
+
<span class="ruby-comment cmt"># turned on in production mode</span>
|
452
|
+
<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">developer_mode?</span>
|
453
|
+
<span class="ruby-identifier">segment</span> = <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">current_segment</span>
|
454
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segment</span>
|
455
|
+
<span class="ruby-comment cmt"># Strip stack frames off the top that match /new_relic/agent/</span>
|
456
|
+
<span class="ruby-identifier">trace</span> = <span class="ruby-identifier">caller</span>
|
457
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">trace</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">=~</span><span class="ruby-regexp re">/\/lib\/new_relic\/agent\//</span>
|
458
|
+
<span class="ruby-identifier">trace</span>.<span class="ruby-identifier">shift</span>
|
459
|
+
<span class="ruby-keyword kw">end</span>
|
460
|
+
|
461
|
+
<span class="ruby-identifier">trace</span> = <span class="ruby-identifier">trace</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">39</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">trace</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">40</span>
|
462
|
+
<span class="ruby-identifier">segment</span>[<span class="ruby-identifier">:backtrace</span>] = <span class="ruby-identifier">trace</span>
|
463
|
+
<span class="ruby-keyword kw">end</span>
|
464
|
+
<span class="ruby-keyword kw">end</span>
|
465
|
+
<span class="ruby-keyword kw">end</span>
|
466
|
+
</pre>
|
467
|
+
</div>
|
468
|
+
</div>
|
469
|
+
</div>
|
470
|
+
|
471
|
+
<div id="method-M000292" class="method-detail">
|
472
|
+
<a name="M000292"></a>
|
473
|
+
|
474
|
+
<div class="method-heading">
|
475
|
+
<a href="#M000292" class="method-signature">
|
476
|
+
<span class="method-name">notice_scope_empty</span><span class="method-args">(time=Time.now.to_f)</span>
|
477
|
+
</a>
|
478
|
+
</div>
|
479
|
+
|
480
|
+
<div class="method-description">
|
481
|
+
<p>
|
482
|
+
This is called when we are done with the transaction. We‘ve unwound
|
483
|
+
the stack to the top level.
|
484
|
+
</p>
|
485
|
+
<p><a class="source-toggle" href="#"
|
486
|
+
onclick="toggleCode('M000292-source');return false;">[Source]</a></p>
|
487
|
+
<div class="method-source-code" id="M000292-source">
|
488
|
+
<pre>
|
489
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 88</span>
|
490
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notice_scope_empty</span>(<span class="ruby-identifier">time</span>=<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>)
|
491
|
+
|
492
|
+
<span class="ruby-identifier">last_builder</span> = <span class="ruby-identifier">builder</span>
|
493
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">last_builder</span>
|
494
|
+
|
495
|
+
<span class="ruby-identifier">last_builder</span>.<span class="ruby-identifier">finish_trace</span>(<span class="ruby-identifier">time</span>)
|
496
|
+
<span class="ruby-identifier">clear_builder</span>
|
497
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">last_builder</span>.<span class="ruby-identifier">ignored?</span>
|
498
|
+
|
499
|
+
<span class="ruby-ivar">@samples_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
500
|
+
<span class="ruby-ivar">@last_sample</span> = <span class="ruby-identifier">last_builder</span>.<span class="ruby-identifier">sample</span>
|
501
|
+
|
502
|
+
<span class="ruby-ivar">@random_sample</span> = <span class="ruby-ivar">@last_sample</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@random_sampling</span>
|
503
|
+
|
504
|
+
<span class="ruby-comment cmt"># ensure we don't collect more than a specified number of samples in memory</span>
|
505
|
+
<span class="ruby-ivar">@samples</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@last_sample</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">developer_mode?</span>
|
506
|
+
<span class="ruby-ivar">@samples</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@samples</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-ivar">@max_samples</span>
|
507
|
+
|
508
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@slowest_sample</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@slowest_sample</span>.<span class="ruby-identifier">duration</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@last_sample</span>.<span class="ruby-identifier">duration</span>
|
509
|
+
<span class="ruby-ivar">@slowest_sample</span> = <span class="ruby-ivar">@last_sample</span>
|
510
|
+
<span class="ruby-keyword kw">end</span>
|
511
|
+
<span class="ruby-keyword kw">end</span>
|
512
|
+
<span class="ruby-keyword kw">end</span>
|
513
|
+
</pre>
|
514
|
+
</div>
|
515
|
+
</div>
|
516
|
+
</div>
|
517
|
+
|
518
|
+
<div id="method-M000297" class="method-detail">
|
519
|
+
<a name="M000297"></a>
|
520
|
+
|
521
|
+
<div class="method-heading">
|
522
|
+
<a href="#M000297" class="method-signature">
|
523
|
+
<span class="method-name">notice_sql</span><span class="method-args">(sql, config, duration)</span>
|
524
|
+
</a>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div class="method-description">
|
528
|
+
<p><a class="source-toggle" href="#"
|
529
|
+
onclick="toggleCode('M000297-source');return false;">[Source]</a></p>
|
530
|
+
<div class="method-source-code" id="M000297-source">
|
531
|
+
<pre>
|
532
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 132</span>
|
533
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notice_sql</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">config</span>, <span class="ruby-identifier">duration</span>)
|
534
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">builder</span>
|
535
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-identifier">current</span>[<span class="ruby-identifier">:record_sql</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span>
|
536
|
+
<span class="ruby-identifier">segment</span> = <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">current_segment</span>
|
537
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segment</span>
|
538
|
+
<span class="ruby-identifier">current_sql</span> = <span class="ruby-identifier">segment</span>[<span class="ruby-identifier">:sql</span>]
|
539
|
+
<span class="ruby-identifier">sql</span> = <span class="ruby-identifier">current_sql</span> <span class="ruby-operator">+</span> <span class="ruby-value str">";\n"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sql</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current_sql</span>
|
540
|
+
|
541
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sql</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> (<span class="ruby-constant">MAX_SQL_LENGTH</span> <span class="ruby-operator">-</span> <span class="ruby-value">4</span>)
|
542
|
+
<span class="ruby-identifier">sql</span> = <span class="ruby-identifier">sql</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-constant">MAX_SQL_LENGTH</span><span class="ruby-operator">-</span><span class="ruby-value">4</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">'...'</span>
|
543
|
+
<span class="ruby-keyword kw">end</span>
|
544
|
+
|
545
|
+
<span class="ruby-identifier">segment</span>[<span class="ruby-identifier">:sql</span>] = <span class="ruby-identifier">sql</span>
|
546
|
+
<span class="ruby-identifier">segment</span>[<span class="ruby-identifier">:connection_config</span>] = <span class="ruby-identifier">config</span>
|
547
|
+
<span class="ruby-identifier">segment</span>[<span class="ruby-identifier">:backtrace</span>] = <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@stack_trace_threshold</span>
|
548
|
+
<span class="ruby-keyword kw">end</span>
|
549
|
+
<span class="ruby-keyword kw">end</span>
|
550
|
+
<span class="ruby-keyword kw">end</span>
|
551
|
+
</pre>
|
552
|
+
</div>
|
553
|
+
</div>
|
554
|
+
</div>
|
555
|
+
|
556
|
+
<div id="method-M000293" class="method-detail">
|
557
|
+
<a name="M000293"></a>
|
558
|
+
|
559
|
+
<div class="method-heading">
|
560
|
+
<a href="#M000293" class="method-signature">
|
561
|
+
<span class="method-name">notice_transaction</span><span class="method-args">(path, uri=nil, params={})</span>
|
562
|
+
</a>
|
563
|
+
</div>
|
564
|
+
|
565
|
+
<div class="method-description">
|
566
|
+
<p><a class="source-toggle" href="#"
|
567
|
+
onclick="toggleCode('M000293-source');return false;">[Source]</a></p>
|
568
|
+
<div class="method-source-code" id="M000293-source">
|
569
|
+
<pre>
|
570
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 112</span>
|
571
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notice_transaction</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">uri</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">params</span>={})
|
572
|
+
<span class="ruby-identifier">builder</span>.<span class="ruby-identifier">set_transaction_info</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">disabled</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">builder</span>
|
573
|
+
<span class="ruby-keyword kw">end</span>
|
574
|
+
</pre>
|
575
|
+
</div>
|
576
|
+
</div>
|
577
|
+
</div>
|
578
|
+
|
579
|
+
<div id="method-M000296" class="method-detail">
|
580
|
+
<a name="M000296"></a>
|
581
|
+
|
582
|
+
<div class="method-heading">
|
583
|
+
<a href="#M000296" class="method-signature">
|
584
|
+
<span class="method-name">notice_transaction_cpu_time</span><span class="method-args">(cpu_time)</span>
|
585
|
+
</a>
|
586
|
+
</div>
|
587
|
+
|
588
|
+
<div class="method-description">
|
589
|
+
<p><a class="source-toggle" href="#"
|
590
|
+
onclick="toggleCode('M000296-source');return false;">[Source]</a></p>
|
591
|
+
<div class="method-source-code" id="M000296-source">
|
592
|
+
<pre>
|
593
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 123</span>
|
594
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notice_transaction_cpu_time</span>(<span class="ruby-identifier">cpu_time</span>)
|
595
|
+
<span class="ruby-identifier">builder</span>.<span class="ruby-identifier">set_transaction_cpu_time</span>(<span class="ruby-identifier">cpu_time</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">builder</span>
|
596
|
+
<span class="ruby-keyword kw">end</span>
|
597
|
+
</pre>
|
598
|
+
</div>
|
599
|
+
</div>
|
600
|
+
</div>
|
601
|
+
|
602
|
+
<div id="method-M000299" class="method-detail">
|
603
|
+
<a name="M000299"></a>
|
604
|
+
|
605
|
+
<div class="method-heading">
|
606
|
+
<a href="#M000299" class="method-signature">
|
607
|
+
<span class="method-name">reset!</span><span class="method-args">()</span>
|
608
|
+
</a>
|
609
|
+
</div>
|
610
|
+
|
611
|
+
<div class="method-description">
|
612
|
+
<p>
|
613
|
+
reset samples without rebooting the web server
|
614
|
+
</p>
|
615
|
+
<p><a class="source-toggle" href="#"
|
616
|
+
onclick="toggleCode('M000299-source');return false;">[Source]</a></p>
|
617
|
+
<div class="method-source-code" id="M000299-source">
|
618
|
+
<pre>
|
619
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 197</span>
|
620
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset!</span>
|
621
|
+
<span class="ruby-ivar">@samples</span> = []
|
622
|
+
<span class="ruby-ivar">@last_sample</span> = <span class="ruby-keyword kw">nil</span>
|
623
|
+
<span class="ruby-keyword kw">end</span>
|
624
|
+
</pre>
|
625
|
+
</div>
|
626
|
+
</div>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
<div id="method-M000287" class="method-detail">
|
630
|
+
<a name="M000287"></a>
|
631
|
+
|
632
|
+
<div class="method-heading">
|
633
|
+
<a href="#M000287" class="method-signature">
|
634
|
+
<span class="method-name">sampling_rate=</span><span class="method-args">(val)</span>
|
635
|
+
</a>
|
636
|
+
</div>
|
637
|
+
|
638
|
+
<div class="method-description">
|
639
|
+
<p><a class="source-toggle" href="#"
|
640
|
+
onclick="toggleCode('M000287-source');return false;">[Source]</a></p>
|
641
|
+
<div class="method-source-code" id="M000287-source">
|
642
|
+
<pre>
|
643
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 41</span>
|
644
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sampling_rate=</span>(<span class="ruby-identifier">val</span>)
|
645
|
+
<span class="ruby-ivar">@sampling_rate</span> = <span class="ruby-identifier">val</span>
|
646
|
+
<span class="ruby-ivar">@harvest_count</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">val</span>)
|
647
|
+
<span class="ruby-keyword kw">end</span>
|
648
|
+
</pre>
|
649
|
+
</div>
|
650
|
+
</div>
|
651
|
+
</div>
|
652
|
+
|
653
|
+
<div id="method-M000290" class="method-detail">
|
654
|
+
<a name="M000290"></a>
|
655
|
+
|
656
|
+
<div class="method-heading">
|
657
|
+
<a href="#M000290" class="method-signature">
|
658
|
+
<span class="method-name">scope_depth</span><span class="method-args">()</span>
|
659
|
+
</a>
|
660
|
+
</div>
|
661
|
+
|
662
|
+
<div class="method-description">
|
663
|
+
<p><a class="source-toggle" href="#"
|
664
|
+
onclick="toggleCode('M000290-source');return false;">[Source]</a></p>
|
665
|
+
<div class="method-source-code" id="M000290-source">
|
666
|
+
<pre>
|
667
|
+
<span class="ruby-comment cmt"># File lib/new_relic/agent/transaction_sampler.rb, line 74</span>
|
668
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scope_depth</span>
|
669
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">builder</span>
|
670
|
+
|
671
|
+
<span class="ruby-identifier">builder</span>.<span class="ruby-identifier">scope_depth</span>
|
672
|
+
<span class="ruby-keyword kw">end</span>
|
673
|
+
</pre>
|
674
|
+
</div>
|
675
|
+
</div>
|
676
|
+
</div>
|
677
|
+
|
678
|
+
|
679
|
+
</div>
|
680
|
+
|
681
|
+
|
682
|
+
</div>
|
683
|
+
|
684
|
+
|
685
|
+
<div id="validator-badges">
|
686
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
687
|
+
</div>
|
688
|
+
|
689
|
+
</body>
|
690
|
+
</html>
|