newrelic_rpm 2.10.8 → 2.11.0.beta
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of newrelic_rpm might be problematic. Click here for more details.
- data/CHANGELOG +15 -3
- data/lib/new_relic/agent.rb +17 -6
- data/lib/new_relic/agent/agent.rb +98 -77
- data/lib/new_relic/agent/busy_calculator.rb +1 -1
- data/lib/new_relic/agent/error_collector.rb +6 -3
- data/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +0 -2
- data/lib/new_relic/agent/instrumentation/memcache.rb +0 -1
- data/lib/new_relic/agent/instrumentation/metric_frame.rb +8 -2
- data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +3 -3
- data/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb +10 -0
- data/lib/new_relic/agent/method_tracer.rb +1 -1
- data/lib/new_relic/agent/shim_agent.rb +1 -1
- data/lib/new_relic/agent/stats_engine.rb +1 -1
- data/lib/new_relic/agent/stats_engine/samplers.rb +2 -2
- data/lib/new_relic/control.rb +6 -3
- data/lib/new_relic/rack/metric_app.rb +4 -4
- data/lib/new_relic/version.rb +3 -3
- data/newrelic.yml +3 -3
- data/newrelic_rpm.gemspec +4 -192
- data/test/new_relic/agent/rpm_agent_test.rb +15 -2
- data/test/new_relic/agent/task_instrumentation_test.rb +3 -2
- metadata +12 -197
- data/rdoc/classes/NewRelic.html +0 -293
- data/rdoc/classes/NewRelic/Agent.html +0 -810
- data/rdoc/classes/NewRelic/Agent/Agent.html +0 -742
- data/rdoc/classes/NewRelic/Agent/BackgroundLoadingError.html +0 -111
- data/rdoc/classes/NewRelic/Agent/BusyCalculator.html +0 -309
- data/rdoc/classes/NewRelic/Agent/CollectionHelper.html +0 -196
- data/rdoc/classes/NewRelic/Agent/ErrorCollector.html +0 -378
- data/rdoc/classes/NewRelic/Agent/ForceDisconnectException.html +0 -118
- data/rdoc/classes/NewRelic/Agent/ForceRestartException.html +0 -117
- data/rdoc/classes/NewRelic/Agent/IgnoreSilentlyException.html +0 -118
- data/rdoc/classes/NewRelic/Agent/Instrumentation.html +0 -174
- data/rdoc/classes/NewRelic/Agent/Instrumentation/ActiveRecordInstrumentation.html +0 -221
- data/rdoc/classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation.html +0 -349
- data/rdoc/classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation/ClassMethods.html +0 -277
- data/rdoc/classes/NewRelic/Agent/Instrumentation/DelayedJobInstrumentation.html +0 -112
- data/rdoc/classes/NewRelic/Agent/Instrumentation/MetricFrame.html +0 -1007
- data/rdoc/classes/NewRelic/Agent/Instrumentation/Rack.html +0 -321
- data/rdoc/classes/NewRelic/Agent/Instrumentation/Sinatra.html +0 -176
- data/rdoc/classes/NewRelic/Agent/LicenseException.html +0 -117
- data/rdoc/classes/NewRelic/Agent/MethodTracer.html +0 -150
- data/rdoc/classes/NewRelic/Agent/MethodTracer/ClassMethods.html +0 -295
- data/rdoc/classes/NewRelic/Agent/MethodTracer/InstanceMethods.html +0 -284
- data/rdoc/classes/NewRelic/Agent/PostTooBigException.html +0 -120
- data/rdoc/classes/NewRelic/Agent/Sampler.html +0 -314
- data/rdoc/classes/NewRelic/Agent/Sampler/Unsupported.html +0 -117
- data/rdoc/classes/NewRelic/Agent/Samplers.html +0 -126
- data/rdoc/classes/NewRelic/Agent/Samplers/CpuSampler.html +0 -327
- data/rdoc/classes/NewRelic/Agent/Samplers/DelayedJobLockSampler.html +0 -296
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler.html +0 -321
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/Base.html +0 -186
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/JavaHeapSampler.html +0 -173
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/ProcStatus.html +0 -216
- data/rdoc/classes/NewRelic/Agent/Samplers/MemorySampler/ShellPS.html +0 -207
- data/rdoc/classes/NewRelic/Agent/Samplers/ObjectSampler.html +0 -222
- data/rdoc/classes/NewRelic/Agent/ServerError.html +0 -117
- data/rdoc/classes/NewRelic/Agent/ShimAgent.html +0 -297
- data/rdoc/classes/NewRelic/Agent/StatsEngine.html +0 -204
- data/rdoc/classes/NewRelic/Agent/StatsEngine/MetricStats.html +0 -441
- data/rdoc/classes/NewRelic/Agent/StatsEngine/Samplers.html +0 -237
- data/rdoc/classes/NewRelic/Agent/StatsEngine/ScopeStackElement.html +0 -178
- data/rdoc/classes/NewRelic/Agent/StatsEngine/Transactions.html +0 -385
- data/rdoc/classes/NewRelic/Agent/TransactionSampleBuilder.html +0 -505
- data/rdoc/classes/NewRelic/Agent/TransactionSampler.html +0 -690
- data/rdoc/classes/NewRelic/Agent/WorkerLoop.html +0 -305
- data/rdoc/classes/NewRelic/Agent/WorkerLoop/LoopTask.html +0 -224
- data/rdoc/classes/NewRelic/ApdexStats.html +0 -196
- data/rdoc/classes/NewRelic/BasicStats.html +0 -113
- data/rdoc/classes/NewRelic/ChainedCall.html +0 -180
- data/rdoc/classes/NewRelic/Commands.html +0 -112
- data/rdoc/classes/NewRelic/Commands/CommandFailure.html +0 -167
- data/rdoc/classes/NewRelic/Commands/Deployments.html +0 -285
- data/rdoc/classes/NewRelic/Control.html +0 -1760
- data/rdoc/classes/NewRelic/Control/External.html +0 -148
- data/rdoc/classes/NewRelic/Control/Merb.html +0 -227
- data/rdoc/classes/NewRelic/Control/Rails.html +0 -542
- data/rdoc/classes/NewRelic/Control/Ruby.html +0 -266
- data/rdoc/classes/NewRelic/Control/Sinatra.html +0 -178
- data/rdoc/classes/NewRelic/DelayedJobInjection.html +0 -118
- data/rdoc/classes/NewRelic/Histogram.html +0 -226
- data/rdoc/classes/NewRelic/Histogram/Bucket.html +0 -319
- data/rdoc/classes/NewRelic/Histogram/Shim.html +0 -144
- data/rdoc/classes/NewRelic/LocalEnvironment.html +0 -572
- data/rdoc/classes/NewRelic/MerbBootLoader.html +0 -146
- data/rdoc/classes/NewRelic/MethodTraceStats.html +0 -250
- data/rdoc/classes/NewRelic/MetricData.html +0 -347
- data/rdoc/classes/NewRelic/MetricParser.html +0 -747
- data/rdoc/classes/NewRelic/MetricParser/ActionMailer.html +0 -170
- data/rdoc/classes/NewRelic/MetricParser/ActiveMerchant.html +0 -267
- data/rdoc/classes/NewRelic/MetricParser/ActiveRecord.html +0 -250
- data/rdoc/classes/NewRelic/MetricParser/Controller.html +0 -363
- data/rdoc/classes/NewRelic/MetricParser/ControllerCPU.html +0 -319
- data/rdoc/classes/NewRelic/MetricParser/Errors.html +0 -170
- data/rdoc/classes/NewRelic/MetricParser/External.html +0 -339
- data/rdoc/classes/NewRelic/MetricParser/MemCache.html +0 -340
- data/rdoc/classes/NewRelic/MetricParser/OtherTransaction.html +0 -205
- data/rdoc/classes/NewRelic/MetricParser/View.html +0 -381
- data/rdoc/classes/NewRelic/MetricParser/WebFrontend.html +0 -182
- data/rdoc/classes/NewRelic/MetricParser/WebService.html +0 -172
- data/rdoc/classes/NewRelic/MetricSpec.html +0 -406
- data/rdoc/classes/NewRelic/Metrics.html +0 -138
- data/rdoc/classes/NewRelic/NoticedError.html +0 -200
- data/rdoc/classes/NewRelic/Rack.html +0 -112
- data/rdoc/classes/NewRelic/Rack/MetricApp.html +0 -193
- data/rdoc/classes/NewRelic/Rack/Status.html +0 -165
- data/rdoc/classes/NewRelic/ScopedMethodTraceStats.html +0 -225
- data/rdoc/classes/NewRelic/Stats.html +0 -917
- data/rdoc/classes/NewRelic/StatsBase.html +0 -346
- data/rdoc/classes/NewRelic/TransactionAnalysis.html +0 -269
- data/rdoc/classes/NewRelic/TransactionAnalysis/SegmentSummary.html +0 -338
- data/rdoc/classes/NewRelic/TransactionSample.html +0 -766
- data/rdoc/classes/NewRelic/TransactionSample/CompositeSegment.html +0 -195
- data/rdoc/classes/NewRelic/TransactionSample/FakeSegment.html +0 -113
- data/rdoc/classes/NewRelic/TransactionSample/IDGenerator.html +0 -178
- data/rdoc/classes/NewRelic/TransactionSample/Segment.html +0 -920
- data/rdoc/classes/NewRelic/TransactionSample/SummarySegment.html +0 -180
- data/rdoc/classes/NewRelic/VersionNumber.html +0 -338
- data/rdoc/classes/NewRelicApi.html +0 -270
- data/rdoc/classes/NewRelicApi/Account.html +0 -178
- data/rdoc/classes/NewRelicApi/Account/AccountUsage.html +0 -111
- data/rdoc/classes/NewRelicApi/Account/AccountView.html +0 -146
- data/rdoc/classes/NewRelicApi/Application.html +0 -139
- data/rdoc/classes/NewRelicApi/Application/Agent.html +0 -119
- data/rdoc/classes/NewRelicApi/Deployment.html +0 -123
- data/rdoc/classes/NewRelicApi/Subscription.html +0 -111
- data/rdoc/classes/NewRelicApi/ThresholdValue.html +0 -174
- data/rdoc/classes/NewRelicApi/User.html +0 -111
- data/rdoc/created.rid +0 -1
- data/rdoc/files/CHANGELOG.html +0 -649
- data/rdoc/files/LICENSE.html +0 -143
- data/rdoc/files/lib/new_relic/agent/agent_rb.html +0 -113
- data/rdoc/files/lib/new_relic/agent/busy_calculator_rb.html +0 -115
- data/rdoc/files/lib/new_relic/agent/chained_call_rb.html +0 -107
- data/rdoc/files/lib/new_relic/agent/collection_helper_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/error_collector_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/instrumentation/active_merchant_rb.html +0 -107
- data/rdoc/files/lib/new_relic/agent/instrumentation/active_record_instrumentation_rb.html +0 -108
- data/rdoc/files/lib/new_relic/agent/instrumentation/authlogic_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/instrumentation/controller_instrumentation_rb.html +0 -108
- data/rdoc/files/lib/new_relic/agent/instrumentation/data_mapper_rb.html +0 -191
- data/rdoc/files/lib/new_relic/agent/instrumentation/delayed_job_instrumentation_rb.html +0 -109
- data/rdoc/files/lib/new_relic/agent/instrumentation/memcache_rb.html +0 -152
- data/rdoc/files/lib/new_relic/agent/instrumentation/merb/controller_rb.html +0 -155
- data/rdoc/files/lib/new_relic/agent/instrumentation/merb/errors_rb.html +0 -107
- data/rdoc/files/lib/new_relic/agent/instrumentation/metric_frame_rb.html +0 -113
- data/rdoc/files/lib/new_relic/agent/instrumentation/net_rb.html +0 -172
- data/rdoc/files/lib/new_relic/agent/instrumentation/passenger_instrumentation_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/instrumentation/rack_rb.html +0 -108
- data/rdoc/files/lib/new_relic/agent/instrumentation/rails/action_controller_rb.html +0 -152
- data/rdoc/files/lib/new_relic/agent/instrumentation/rails/action_web_service_rb.html +0 -108
- data/rdoc/files/lib/new_relic/agent/instrumentation/rails/errors_rb.html +0 -167
- data/rdoc/files/lib/new_relic/agent/instrumentation/sinatra_rb.html +0 -108
- data/rdoc/files/lib/new_relic/agent/method_tracer_rb.html +0 -108
- data/rdoc/files/lib/new_relic/agent/sampler_rb.html +0 -116
- data/rdoc/files/lib/new_relic/agent/samplers/cpu_sampler_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/samplers/delayed_job_lock_sampler_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/samplers/memory_sampler_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/samplers/object_sampler_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/shim_agent_rb.html +0 -108
- data/rdoc/files/lib/new_relic/agent/stats_engine/metric_stats_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/stats_engine/samplers_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/stats_engine/transactions_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/stats_engine_rb.html +0 -110
- data/rdoc/files/lib/new_relic/agent/transaction_sampler_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent/worker_loop_rb.html +0 -101
- data/rdoc/files/lib/new_relic/agent_rb.html +0 -204
- data/rdoc/files/lib/new_relic/commands/deployments_rb.html +0 -119
- data/rdoc/files/lib/new_relic/commands/new_relic_commands_rb.html +0 -108
- data/rdoc/files/lib/new_relic/control/external_rb.html +0 -117
- data/rdoc/files/lib/new_relic/control/merb_rb.html +0 -101
- data/rdoc/files/lib/new_relic/control/rails_rb.html +0 -108
- data/rdoc/files/lib/new_relic/control/ruby_rb.html +0 -110
- data/rdoc/files/lib/new_relic/control/sinatra_rb.html +0 -108
- data/rdoc/files/lib/new_relic/control_rb.html +0 -116
- data/rdoc/files/lib/new_relic/delayed_job_injection_rb.html +0 -180
- data/rdoc/files/lib/new_relic/histogram_rb.html +0 -114
- data/rdoc/files/lib/new_relic/local_environment_rb.html +0 -111
- data/rdoc/files/lib/new_relic/merbtasks_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_data_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/action_mailer_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/active_merchant_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/active_record_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/controller_cpu_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/controller_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/errors_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/external_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/mem_cache_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/other_transaction_rb.html +0 -108
- data/rdoc/files/lib/new_relic/metric_parser/view_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser/web_frontend_rb.html +0 -107
- data/rdoc/files/lib/new_relic/metric_parser/web_service_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_parser_rb.html +0 -101
- data/rdoc/files/lib/new_relic/metric_spec_rb.html +0 -108
- data/rdoc/files/lib/new_relic/metrics_rb.html +0 -101
- data/rdoc/files/lib/new_relic/noticed_error_rb.html +0 -107
- data/rdoc/files/lib/new_relic/rack/metric_app_rb.html +0 -108
- data/rdoc/files/lib/new_relic/rack_app_rb.html +0 -110
- data/rdoc/files/lib/new_relic/recipes_rb.html +0 -128
- data/rdoc/files/lib/new_relic/stats_rb.html +0 -101
- data/rdoc/files/lib/new_relic/transaction_analysis_rb.html +0 -108
- data/rdoc/files/lib/new_relic/transaction_sample_rb.html +0 -101
- data/rdoc/files/lib/new_relic/version_rb.html +0 -101
- data/rdoc/files/lib/new_relic_api_rb.html +0 -145
- data/rdoc/files/lib/newrelic_rpm_rb.html +0 -147
- data/rdoc/files/lib/tasks/all_rb.html +0 -107
- data/rdoc/fr_class_index.html +0 -134
- data/rdoc/fr_file_index.html +0 -103
- data/rdoc/fr_method_index.html +0 -568
- data/rdoc/index.html +0 -24
- data/rdoc/rdoc-style.css +0 -208
@@ -1,917 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: NewRelic::Stats</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::Stats</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/new_relic/stats_rb.html">
|
59
|
-
lib/new_relic/stats.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="#M000012">absent?</a>
|
84
|
-
<a href="#M000039">apdex_score</a>
|
85
|
-
<a href="#M000023">as_percentage</a>
|
86
|
-
<a href="#M000022">as_percentage_of</a>
|
87
|
-
<a href="#M000014">average_call_time</a>
|
88
|
-
<a href="#M000015">average_exclusive_time</a>
|
89
|
-
<a href="#M000031">average_response_time</a>
|
90
|
-
<a href="#M000030">average_value</a>
|
91
|
-
<a href="#M000025">calls_per_minute</a>
|
92
|
-
<a href="#M000024">duration</a>
|
93
|
-
<a href="#M000029">exclusive_time_percentage</a>
|
94
|
-
<a href="#M000036">fraction_of</a>
|
95
|
-
<a href="#M000038">get_apdex</a>
|
96
|
-
<a href="#M000020">is_reset?</a>
|
97
|
-
<a href="#M000018">merge</a>
|
98
|
-
<a href="#M000017">merge!</a>
|
99
|
-
<a href="#M000037">multiply_by</a>
|
100
|
-
<a href="#M000032">requests_per_minute</a>
|
101
|
-
<a href="#M000021">reset</a>
|
102
|
-
<a href="#M000035">round!</a>
|
103
|
-
<a href="#M000019">split</a>
|
104
|
-
<a href="#M000027">standard_deviation</a>
|
105
|
-
<a href="#M000016">sum_merge!</a>
|
106
|
-
<a href="#M000034">summary</a>
|
107
|
-
<a href="#M000028">time_percentage</a>
|
108
|
-
<a href="#M000013">time_str</a>
|
109
|
-
<a href="#M000033">to_s</a>
|
110
|
-
<a href="#M000026">total_call_time_per_minute</a>
|
111
|
-
</div>
|
112
|
-
</div>
|
113
|
-
|
114
|
-
</div>
|
115
|
-
|
116
|
-
|
117
|
-
<!-- if includes -->
|
118
|
-
|
119
|
-
<div id="section">
|
120
|
-
|
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-M000012" class="method-detail">
|
133
|
-
<a name="M000012"></a>
|
134
|
-
|
135
|
-
<div class="method-heading">
|
136
|
-
<a href="#M000012" class="method-signature">
|
137
|
-
<span class="method-name">absent?</span><span class="method-args">()</span>
|
138
|
-
</a>
|
139
|
-
</div>
|
140
|
-
|
141
|
-
<div class="method-description">
|
142
|
-
<p><a class="source-toggle" href="#"
|
143
|
-
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
144
|
-
<div class="method-source-code" id="M000012-source">
|
145
|
-
<pre>
|
146
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 5</span>
|
147
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">absent?</span>
|
148
|
-
<span class="ruby-comment cmt"># guess on absent values</span>
|
149
|
-
<span class="ruby-identifier">call_count</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
150
|
-
<span class="ruby-keyword kw">end</span>
|
151
|
-
</pre>
|
152
|
-
</div>
|
153
|
-
</div>
|
154
|
-
</div>
|
155
|
-
|
156
|
-
<div id="method-M000039" class="method-detail">
|
157
|
-
<a name="M000039"></a>
|
158
|
-
|
159
|
-
<div class="method-heading">
|
160
|
-
<a href="#M000039" class="method-signature">
|
161
|
-
<span class="method-name">apdex_score</span><span class="method-args">()</span>
|
162
|
-
</a>
|
163
|
-
</div>
|
164
|
-
|
165
|
-
<div class="method-description">
|
166
|
-
<p><a class="source-toggle" href="#"
|
167
|
-
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
168
|
-
<div class="method-source-code" id="M000039-source">
|
169
|
-
<pre>
|
170
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 237</span>
|
171
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">apdex_score</span>
|
172
|
-
<span class="ruby-identifier">s</span>, <span class="ruby-identifier">t</span>, <span class="ruby-identifier">f</span> = <span class="ruby-identifier">get_apdex</span>
|
173
|
-
(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">t</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span>)) <span class="ruby-operator">/</span> (<span class="ruby-identifier">s</span><span class="ruby-operator">+</span><span class="ruby-identifier">t</span><span class="ruby-operator">+</span><span class="ruby-identifier">f</span>).<span class="ruby-identifier">to_f</span>
|
174
|
-
<span class="ruby-keyword kw">end</span>
|
175
|
-
</pre>
|
176
|
-
</div>
|
177
|
-
</div>
|
178
|
-
</div>
|
179
|
-
|
180
|
-
<div id="method-M000023" class="method-detail">
|
181
|
-
<a name="M000023"></a>
|
182
|
-
|
183
|
-
<div class="method-heading">
|
184
|
-
<a href="#M000023" class="method-signature">
|
185
|
-
<span class="method-name">as_percentage</span><span class="method-args">()</span>
|
186
|
-
</a>
|
187
|
-
</div>
|
188
|
-
|
189
|
-
<div class="method-description">
|
190
|
-
<p>
|
191
|
-
the stat total_call_time is a percent
|
192
|
-
</p>
|
193
|
-
<p><a class="source-toggle" href="#"
|
194
|
-
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
195
|
-
<div class="method-source-code" id="M000023-source">
|
196
|
-
<pre>
|
197
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 126</span>
|
198
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as_percentage</span>
|
199
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">call_count</span>.<span class="ruby-identifier">zero?</span>
|
200
|
-
<span class="ruby-value">0</span>
|
201
|
-
<span class="ruby-keyword kw">else</span>
|
202
|
-
(<span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">call_count</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100.0</span>
|
203
|
-
<span class="ruby-keyword kw">end</span>
|
204
|
-
<span class="ruby-keyword kw">end</span>
|
205
|
-
</pre>
|
206
|
-
</div>
|
207
|
-
</div>
|
208
|
-
</div>
|
209
|
-
|
210
|
-
<div id="method-M000022" class="method-detail">
|
211
|
-
<a name="M000022"></a>
|
212
|
-
|
213
|
-
<div class="method-heading">
|
214
|
-
<a href="#M000022" class="method-signature">
|
215
|
-
<span class="method-name">as_percentage_of</span><span class="method-args">(other_stats)</span>
|
216
|
-
</a>
|
217
|
-
</div>
|
218
|
-
|
219
|
-
<div class="method-description">
|
220
|
-
<p><a class="source-toggle" href="#"
|
221
|
-
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
222
|
-
<div class="method-source-code" id="M000022-source">
|
223
|
-
<pre>
|
224
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 120</span>
|
225
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as_percentage_of</span>(<span class="ruby-identifier">other_stats</span>)
|
226
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">other_stats</span>.<span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
227
|
-
<span class="ruby-keyword kw">return</span> (<span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">other_stats</span>.<span class="ruby-identifier">total_call_time</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100.0</span>
|
228
|
-
<span class="ruby-keyword kw">end</span>
|
229
|
-
</pre>
|
230
|
-
</div>
|
231
|
-
</div>
|
232
|
-
</div>
|
233
|
-
|
234
|
-
<div id="method-M000014" class="method-detail">
|
235
|
-
<a name="M000014"></a>
|
236
|
-
|
237
|
-
<div class="method-heading">
|
238
|
-
<a href="#M000014" class="method-signature">
|
239
|
-
<span class="method-name">average_call_time</span><span class="method-args">()</span>
|
240
|
-
</a>
|
241
|
-
</div>
|
242
|
-
|
243
|
-
<div class="method-description">
|
244
|
-
<p><a class="source-toggle" href="#"
|
245
|
-
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
246
|
-
<div class="method-source-code" id="M000014-source">
|
247
|
-
<pre>
|
248
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 21</span>
|
249
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">average_call_time</span>
|
250
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">call_count</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
251
|
-
<span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">call_count</span>
|
252
|
-
<span class="ruby-keyword kw">end</span>
|
253
|
-
</pre>
|
254
|
-
</div>
|
255
|
-
</div>
|
256
|
-
</div>
|
257
|
-
|
258
|
-
<div id="method-M000015" class="method-detail">
|
259
|
-
<a name="M000015"></a>
|
260
|
-
|
261
|
-
<div class="method-heading">
|
262
|
-
<a href="#M000015" class="method-signature">
|
263
|
-
<span class="method-name">average_exclusive_time</span><span class="method-args">()</span>
|
264
|
-
</a>
|
265
|
-
</div>
|
266
|
-
|
267
|
-
<div class="method-description">
|
268
|
-
<p><a class="source-toggle" href="#"
|
269
|
-
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
270
|
-
<div class="method-source-code" id="M000015-source">
|
271
|
-
<pre>
|
272
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 25</span>
|
273
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">average_exclusive_time</span>
|
274
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">call_count</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
275
|
-
<span class="ruby-identifier">total_exclusive_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">call_count</span>
|
276
|
-
<span class="ruby-keyword kw">end</span>
|
277
|
-
</pre>
|
278
|
-
</div>
|
279
|
-
</div>
|
280
|
-
</div>
|
281
|
-
|
282
|
-
<div id="method-M000031" class="method-detail">
|
283
|
-
<a name="M000031"></a>
|
284
|
-
|
285
|
-
<div class="method-heading">
|
286
|
-
<span class="method-name">average_response_time</span><span class="method-args">()</span>
|
287
|
-
</div>
|
288
|
-
|
289
|
-
<div class="method-description">
|
290
|
-
<p>
|
291
|
-
Alias for <a href="Stats.html#M000014">average_call_time</a>
|
292
|
-
</p>
|
293
|
-
</div>
|
294
|
-
</div>
|
295
|
-
|
296
|
-
<div id="method-M000030" class="method-detail">
|
297
|
-
<a name="M000030"></a>
|
298
|
-
|
299
|
-
<div class="method-heading">
|
300
|
-
<span class="method-name">average_value</span><span class="method-args">()</span>
|
301
|
-
</div>
|
302
|
-
|
303
|
-
<div class="method-description">
|
304
|
-
<p>
|
305
|
-
Alias for <a href="Stats.html#M000014">average_call_time</a>
|
306
|
-
</p>
|
307
|
-
</div>
|
308
|
-
</div>
|
309
|
-
|
310
|
-
<div id="method-M000025" class="method-detail">
|
311
|
-
<a name="M000025"></a>
|
312
|
-
|
313
|
-
<div class="method-heading">
|
314
|
-
<a href="#M000025" class="method-signature">
|
315
|
-
<span class="method-name">calls_per_minute</span><span class="method-args">()</span>
|
316
|
-
</a>
|
317
|
-
</div>
|
318
|
-
|
319
|
-
<div class="method-description">
|
320
|
-
<p><a class="source-toggle" href="#"
|
321
|
-
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
322
|
-
<div class="method-source-code" id="M000025-source">
|
323
|
-
<pre>
|
324
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 138</span>
|
325
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calls_per_minute</span>
|
326
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">duration</span>.<span class="ruby-identifier">zero?</span>
|
327
|
-
<span class="ruby-value">0</span>
|
328
|
-
<span class="ruby-keyword kw">else</span>
|
329
|
-
(<span class="ruby-identifier">call_count</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">duration</span>.<span class="ruby-identifier">to_f</span>) <span class="ruby-operator">*</span> <span class="ruby-value">60.0</span>
|
330
|
-
<span class="ruby-keyword kw">end</span>
|
331
|
-
<span class="ruby-keyword kw">end</span>
|
332
|
-
</pre>
|
333
|
-
</div>
|
334
|
-
</div>
|
335
|
-
</div>
|
336
|
-
|
337
|
-
<div id="method-M000024" class="method-detail">
|
338
|
-
<a name="M000024"></a>
|
339
|
-
|
340
|
-
<div class="method-heading">
|
341
|
-
<a href="#M000024" class="method-signature">
|
342
|
-
<span class="method-name">duration</span><span class="method-args">()</span>
|
343
|
-
</a>
|
344
|
-
</div>
|
345
|
-
|
346
|
-
<div class="method-description">
|
347
|
-
<p><a class="source-toggle" href="#"
|
348
|
-
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
349
|
-
<div class="method-source-code" id="M000024-source">
|
350
|
-
<pre>
|
351
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 134</span>
|
352
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">duration</span>
|
353
|
-
<span class="ruby-identifier">end_time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">begin_time</span>
|
354
|
-
<span class="ruby-keyword kw">end</span>
|
355
|
-
</pre>
|
356
|
-
</div>
|
357
|
-
</div>
|
358
|
-
</div>
|
359
|
-
|
360
|
-
<div id="method-M000029" class="method-detail">
|
361
|
-
<a name="M000029"></a>
|
362
|
-
|
363
|
-
<div class="method-heading">
|
364
|
-
<a href="#M000029" class="method-signature">
|
365
|
-
<span class="method-name">exclusive_time_percentage</span><span class="method-args">()</span>
|
366
|
-
</a>
|
367
|
-
</div>
|
368
|
-
|
369
|
-
<div class="method-description">
|
370
|
-
<p><a class="source-toggle" href="#"
|
371
|
-
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
372
|
-
<div class="method-source-code" id="M000029-source">
|
373
|
-
<pre>
|
374
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 168</span>
|
375
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exclusive_time_percentage</span>
|
376
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
377
|
-
<span class="ruby-identifier">total_exclusive_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">duration</span>
|
378
|
-
<span class="ruby-keyword kw">end</span>
|
379
|
-
</pre>
|
380
|
-
</div>
|
381
|
-
</div>
|
382
|
-
</div>
|
383
|
-
|
384
|
-
<div id="method-M000036" class="method-detail">
|
385
|
-
<a name="M000036"></a>
|
386
|
-
|
387
|
-
<div class="method-heading">
|
388
|
-
<a href="#M000036" class="method-signature">
|
389
|
-
<span class="method-name">fraction_of</span><span class="method-args">(s)</span>
|
390
|
-
</a>
|
391
|
-
</div>
|
392
|
-
|
393
|
-
<div class="method-description">
|
394
|
-
<p>
|
395
|
-
calculate this set of stats to be a percentage fraction of the provided
|
396
|
-
stats, which has an overlapping time window. used as a key part of the <a
|
397
|
-
href="Stats.html#M000019">split</a> algorithm
|
398
|
-
</p>
|
399
|
-
<p><a class="source-toggle" href="#"
|
400
|
-
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
401
|
-
<div class="method-source-code" id="M000036-source">
|
402
|
-
<pre>
|
403
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 209</span>
|
404
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fraction_of</span>(<span class="ruby-identifier">s</span>)
|
405
|
-
<span class="ruby-identifier">min_end</span> = (<span class="ruby-identifier">end_time</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">end_time</span> <span class="ruby-value">? </span><span class="ruby-identifier">end_time</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">end_time</span>)
|
406
|
-
<span class="ruby-identifier">max_begin</span> = (<span class="ruby-identifier">begin_time</span> <span class="ruby-operator">></span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">begin_time</span> <span class="ruby-value">? </span><span class="ruby-identifier">begin_time</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">begin_time</span>)
|
407
|
-
<span class="ruby-identifier">percentage</span> = (<span class="ruby-identifier">min_end</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">max_begin</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">duration</span>
|
408
|
-
|
409
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_exclusive_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">total_exclusive_time</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">percentage</span>
|
410
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_call_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">percentage</span>
|
411
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min_call_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">min_call_time</span>
|
412
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_call_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">max_call_time</span>
|
413
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">call_count</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">call_count</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">percentage</span>
|
414
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sum_of_squares</span> = (<span class="ruby-identifier">s</span>.<span class="ruby-identifier">sum_of_squares</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>) <span class="ruby-operator">*</span> <span class="ruby-identifier">percentage</span>
|
415
|
-
<span class="ruby-keyword kw">end</span>
|
416
|
-
</pre>
|
417
|
-
</div>
|
418
|
-
</div>
|
419
|
-
</div>
|
420
|
-
|
421
|
-
<div id="method-M000038" class="method-detail">
|
422
|
-
<a name="M000038"></a>
|
423
|
-
|
424
|
-
<div class="method-heading">
|
425
|
-
<a href="#M000038" class="method-signature">
|
426
|
-
<span class="method-name">get_apdex</span><span class="method-args">()</span>
|
427
|
-
</a>
|
428
|
-
</div>
|
429
|
-
|
430
|
-
<div class="method-description">
|
431
|
-
<p>
|
432
|
-
returns s,t,f
|
433
|
-
</p>
|
434
|
-
<p><a class="source-toggle" href="#"
|
435
|
-
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
436
|
-
<div class="method-source-code" id="M000038-source">
|
437
|
-
<pre>
|
438
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 233</span>
|
439
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_apdex</span>
|
440
|
-
[<span class="ruby-ivar">@call_count</span>, <span class="ruby-ivar">@total_call_time</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@total_exclusive_time</span>.<span class="ruby-identifier">to_i</span>]
|
441
|
-
<span class="ruby-keyword kw">end</span>
|
442
|
-
</pre>
|
443
|
-
</div>
|
444
|
-
</div>
|
445
|
-
</div>
|
446
|
-
|
447
|
-
<div id="method-M000020" class="method-detail">
|
448
|
-
<a name="M000020"></a>
|
449
|
-
|
450
|
-
<div class="method-heading">
|
451
|
-
<a href="#M000020" class="method-signature">
|
452
|
-
<span class="method-name">is_reset?</span><span class="method-args">()</span>
|
453
|
-
</a>
|
454
|
-
</div>
|
455
|
-
|
456
|
-
<div class="method-description">
|
457
|
-
<p><a class="source-toggle" href="#"
|
458
|
-
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
459
|
-
<div class="method-source-code" id="M000020-source">
|
460
|
-
<pre>
|
461
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 105</span>
|
462
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_reset?</span>
|
463
|
-
<span class="ruby-identifier">call_count</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span><span class="ruby-value">.0</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">total_exclusive_time</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
464
|
-
<span class="ruby-keyword kw">end</span>
|
465
|
-
</pre>
|
466
|
-
</div>
|
467
|
-
</div>
|
468
|
-
</div>
|
469
|
-
|
470
|
-
<div id="method-M000018" class="method-detail">
|
471
|
-
<a name="M000018"></a>
|
472
|
-
|
473
|
-
<div class="method-heading">
|
474
|
-
<a href="#M000018" class="method-signature">
|
475
|
-
<span class="method-name">merge</span><span class="method-args">(other_stats)</span>
|
476
|
-
</a>
|
477
|
-
</div>
|
478
|
-
|
479
|
-
<div class="method-description">
|
480
|
-
<p><a class="source-toggle" href="#"
|
481
|
-
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
482
|
-
<div class="method-source-code" id="M000018-source">
|
483
|
-
<pre>
|
484
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 62</span>
|
485
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge</span> (<span class="ruby-identifier">other_stats</span>)
|
486
|
-
<span class="ruby-identifier">stats</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clone</span>
|
487
|
-
<span class="ruby-identifier">stats</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">other_stats</span>
|
488
|
-
<span class="ruby-keyword kw">end</span>
|
489
|
-
</pre>
|
490
|
-
</div>
|
491
|
-
</div>
|
492
|
-
</div>
|
493
|
-
|
494
|
-
<div id="method-M000017" class="method-detail">
|
495
|
-
<a name="M000017"></a>
|
496
|
-
|
497
|
-
<div class="method-heading">
|
498
|
-
<a href="#M000017" class="method-signature">
|
499
|
-
<span class="method-name">merge!</span><span class="method-args">(other_stats)</span>
|
500
|
-
</a>
|
501
|
-
</div>
|
502
|
-
|
503
|
-
<div class="method-description">
|
504
|
-
<p><a class="source-toggle" href="#"
|
505
|
-
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
506
|
-
<div class="method-source-code" id="M000017-source">
|
507
|
-
<pre>
|
508
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 47</span>
|
509
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge!</span> (<span class="ruby-identifier">other_stats</span>)
|
510
|
-
<span class="ruby-constant">Array</span>(<span class="ruby-identifier">other_stats</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
511
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">total_call_time</span>
|
512
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_exclusive_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">total_exclusive_time</span>
|
513
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min_call_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">min_call_time</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</span>.<span class="ruby-identifier">min_call_time</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">min_call_time</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">call_count</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">call_count</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
514
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_call_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">max_call_time</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">max_call_time</span> <span class="ruby-operator">></span> <span class="ruby-identifier">max_call_time</span>
|
515
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">call_count</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">call_count</span>
|
516
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sum_of_squares</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">sum_of_squares</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">sum_of_squares</span>
|
517
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">begin_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">begin_time</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">begin_time</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">begin_time</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">begin_time</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
518
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">end_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">end_time</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">end_time</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">></span> <span class="ruby-identifier">end_time</span>.<span class="ruby-identifier">to_f</span>
|
519
|
-
<span class="ruby-keyword kw">end</span>
|
520
|
-
|
521
|
-
<span class="ruby-keyword kw">self</span>
|
522
|
-
<span class="ruby-keyword kw">end</span>
|
523
|
-
</pre>
|
524
|
-
</div>
|
525
|
-
</div>
|
526
|
-
</div>
|
527
|
-
|
528
|
-
<div id="method-M000037" class="method-detail">
|
529
|
-
<a name="M000037"></a>
|
530
|
-
|
531
|
-
<div class="method-heading">
|
532
|
-
<a href="#M000037" class="method-signature">
|
533
|
-
<span class="method-name">multiply_by</span><span class="method-args">(percentage)</span>
|
534
|
-
</a>
|
535
|
-
</div>
|
536
|
-
|
537
|
-
<div class="method-description">
|
538
|
-
<p>
|
539
|
-
multiply the total time and rate by the given percentage
|
540
|
-
</p>
|
541
|
-
<p><a class="source-toggle" href="#"
|
542
|
-
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
543
|
-
<div class="method-source-code" id="M000037-source">
|
544
|
-
<pre>
|
545
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 223</span>
|
546
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">multiply_by</span>(<span class="ruby-identifier">percentage</span>)
|
547
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_call_time</span> = <span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">percentage</span>
|
548
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">call_count</span> = <span class="ruby-identifier">call_count</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">percentage</span>
|
549
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sum_of_squares</span> = <span class="ruby-identifier">sum_of_squares</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">percentage</span>
|
550
|
-
|
551
|
-
<span class="ruby-keyword kw">self</span>
|
552
|
-
<span class="ruby-keyword kw">end</span>
|
553
|
-
</pre>
|
554
|
-
</div>
|
555
|
-
</div>
|
556
|
-
</div>
|
557
|
-
|
558
|
-
<div id="method-M000032" class="method-detail">
|
559
|
-
<a name="M000032"></a>
|
560
|
-
|
561
|
-
<div class="method-heading">
|
562
|
-
<span class="method-name">requests_per_minute</span><span class="method-args">()</span>
|
563
|
-
</div>
|
564
|
-
|
565
|
-
<div class="method-description">
|
566
|
-
<p>
|
567
|
-
Alias for <a href="Stats.html#M000025">calls_per_minute</a>
|
568
|
-
</p>
|
569
|
-
</div>
|
570
|
-
</div>
|
571
|
-
|
572
|
-
<div id="method-M000021" class="method-detail">
|
573
|
-
<a name="M000021"></a>
|
574
|
-
|
575
|
-
<div class="method-heading">
|
576
|
-
<a href="#M000021" class="method-signature">
|
577
|
-
<span class="method-name">reset</span><span class="method-args">()</span>
|
578
|
-
</a>
|
579
|
-
</div>
|
580
|
-
|
581
|
-
<div class="method-description">
|
582
|
-
<p><a class="source-toggle" href="#"
|
583
|
-
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
584
|
-
<div class="method-source-code" id="M000021-source">
|
585
|
-
<pre>
|
586
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 109</span>
|
587
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
|
588
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">call_count</span> = <span class="ruby-value">0</span>
|
589
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_call_time</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
590
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_exclusive_time</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
591
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min_call_time</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
592
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_call_time</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
593
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sum_of_squares</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
594
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">begin_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-value">0</span>)
|
595
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">end_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-value">0</span>)
|
596
|
-
<span class="ruby-keyword kw">end</span>
|
597
|
-
</pre>
|
598
|
-
</div>
|
599
|
-
</div>
|
600
|
-
</div>
|
601
|
-
|
602
|
-
<div id="method-M000035" class="method-detail">
|
603
|
-
<a name="M000035"></a>
|
604
|
-
|
605
|
-
<div class="method-heading">
|
606
|
-
<a href="#M000035" class="method-signature">
|
607
|
-
<span class="method-name">round!</span><span class="method-args">()</span>
|
608
|
-
</a>
|
609
|
-
</div>
|
610
|
-
|
611
|
-
<div class="method-description">
|
612
|
-
<p>
|
613
|
-
round all of the values to n decimal points
|
614
|
-
</p>
|
615
|
-
<p><a class="source-toggle" href="#"
|
616
|
-
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
617
|
-
<div class="method-source-code" id="M000035-source">
|
618
|
-
<pre>
|
619
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 196</span>
|
620
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">round!</span>
|
621
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_call_time</span> = <span class="ruby-identifier">round_to_3</span>(<span class="ruby-identifier">total_call_time</span>)
|
622
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_exclusive_time</span> = <span class="ruby-identifier">round_to_3</span>(<span class="ruby-identifier">total_exclusive_time</span>)
|
623
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min_call_time</span> = <span class="ruby-identifier">round_to_3</span>(<span class="ruby-identifier">min_call_time</span>)
|
624
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_call_time</span> = <span class="ruby-identifier">round_to_3</span>(<span class="ruby-identifier">max_call_time</span>)
|
625
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sum_of_squares</span> = <span class="ruby-identifier">round_to_3</span>(<span class="ruby-identifier">sum_of_squares</span>)
|
626
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">begin_time</span> = <span class="ruby-identifier">begin_time</span>
|
627
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">end_time</span> = <span class="ruby-identifier">end_time</span>
|
628
|
-
<span class="ruby-keyword kw">end</span>
|
629
|
-
</pre>
|
630
|
-
</div>
|
631
|
-
</div>
|
632
|
-
</div>
|
633
|
-
|
634
|
-
<div id="method-M000019" class="method-detail">
|
635
|
-
<a name="M000019"></a>
|
636
|
-
|
637
|
-
<div class="method-heading">
|
638
|
-
<a href="#M000019" class="method-signature">
|
639
|
-
<span class="method-name">split</span><span class="method-args">(rollup_begin_time, rollup_period) {|current_begin_time, current_end_time| ...}</span>
|
640
|
-
</a>
|
641
|
-
</div>
|
642
|
-
|
643
|
-
<div class="method-description">
|
644
|
-
<p>
|
645
|
-
<a href="Stats.html#M000019">split</a> into an array of timeslices whose
|
646
|
-
time boundaries start on (begin_time + (n * <a
|
647
|
-
href="Stats.html#M000024">duration</a>)) and whose end time ends on
|
648
|
-
(begin_time * (n + 1) * <a href="Stats.html#M000024">duration</a>), except
|
649
|
-
for the first and last elements, whose begin time and end time are the
|
650
|
-
begin and end times of this stats instance, respectively. Yield to caller
|
651
|
-
for the code that creates the actual stats instance
|
652
|
-
</p>
|
653
|
-
<p><a class="source-toggle" href="#"
|
654
|
-
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
655
|
-
<div class="method-source-code" id="M000019-source">
|
656
|
-
<pre>
|
657
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 73</span>
|
658
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split</span>(<span class="ruby-identifier">rollup_begin_time</span>, <span class="ruby-identifier">rollup_period</span>)
|
659
|
-
<span class="ruby-identifier">rollup_begin_time</span> = <span class="ruby-identifier">rollup_begin_time</span>.<span class="ruby-identifier">to_f</span>
|
660
|
-
<span class="ruby-identifier">rollup_begin_time</span> <span class="ruby-operator">+=</span> ((<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">begin_time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">rollup_begin_time</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">rollup_period</span>).<span class="ruby-identifier">floor</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">rollup_period</span>
|
661
|
-
|
662
|
-
<span class="ruby-identifier">current_begin_time</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">begin_time</span>
|
663
|
-
<span class="ruby-identifier">current_end_time</span> = <span class="ruby-identifier">rollup_begin_time</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rollup_period</span>
|
664
|
-
|
665
|
-
<span class="ruby-keyword kw">return</span> [<span class="ruby-keyword kw">self</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current_end_time</span> <span class="ruby-operator">>=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">end_time</span>
|
666
|
-
|
667
|
-
<span class="ruby-identifier">timeslices</span> = []
|
668
|
-
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">current_end_time</span> <span class="ruby-operator"><</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">end_time</span> <span class="ruby-keyword kw">do</span>
|
669
|
-
<span class="ruby-identifier">ts</span> = <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">current_begin_time</span>, <span class="ruby-identifier">current_end_time</span>)
|
670
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ts</span>
|
671
|
-
<span class="ruby-identifier">ts</span>.<span class="ruby-identifier">fraction_of</span>(<span class="ruby-keyword kw">self</span>)
|
672
|
-
<span class="ruby-identifier">timeslices</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">ts</span>
|
673
|
-
<span class="ruby-keyword kw">end</span>
|
674
|
-
<span class="ruby-identifier">current_begin_time</span> = <span class="ruby-identifier">current_end_time</span>
|
675
|
-
<span class="ruby-identifier">current_end_time</span> = <span class="ruby-identifier">current_begin_time</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rollup_period</span>
|
676
|
-
<span class="ruby-keyword kw">end</span>
|
677
|
-
|
678
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">end_time</span> <span class="ruby-operator">></span> <span class="ruby-identifier">current_begin_time</span>
|
679
|
-
<span class="ruby-identifier">percentage</span> = <span class="ruby-identifier">rollup_period</span> <span class="ruby-operator">/</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">duration</span> <span class="ruby-operator">+</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">begin_time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">rollup_begin_time</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">rollup_period</span>
|
680
|
-
<span class="ruby-identifier">ts</span> = <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">current_begin_time</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">end_time</span>)
|
681
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ts</span>
|
682
|
-
<span class="ruby-identifier">ts</span>.<span class="ruby-identifier">fraction_of</span>(<span class="ruby-keyword kw">self</span>)
|
683
|
-
<span class="ruby-identifier">timeslices</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">ts</span>
|
684
|
-
<span class="ruby-keyword kw">end</span>
|
685
|
-
<span class="ruby-keyword kw">end</span>
|
686
|
-
|
687
|
-
<span class="ruby-identifier">timeslices</span>
|
688
|
-
<span class="ruby-keyword kw">end</span>
|
689
|
-
</pre>
|
690
|
-
</div>
|
691
|
-
</div>
|
692
|
-
</div>
|
693
|
-
|
694
|
-
<div id="method-M000027" class="method-detail">
|
695
|
-
<a name="M000027"></a>
|
696
|
-
|
697
|
-
<div class="method-heading">
|
698
|
-
<a href="#M000027" class="method-signature">
|
699
|
-
<span class="method-name">standard_deviation</span><span class="method-args">()</span>
|
700
|
-
</a>
|
701
|
-
</div>
|
702
|
-
|
703
|
-
<div class="method-description">
|
704
|
-
<p><a class="source-toggle" href="#"
|
705
|
-
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
706
|
-
<div class="method-source-code" id="M000027-source">
|
707
|
-
<pre>
|
708
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 150</span>
|
709
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">standard_deviation</span>
|
710
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">call_count</span> <span class="ruby-operator"><</span> <span class="ruby-value">2</span> <span class="ruby-operator">||</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sum_of_squares</span>.<span class="ruby-identifier">nil?</span>
|
711
|
-
|
712
|
-
<span class="ruby-comment cmt"># Convert sum of squares into standard deviation based on</span>
|
713
|
-
<span class="ruby-comment cmt"># formula for the standard deviation for the entire population</span>
|
714
|
-
<span class="ruby-identifier">x</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sum_of_squares</span> <span class="ruby-operator">-</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">call_count</span> <span class="ruby-operator">*</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">average_value</span><span class="ruby-operator">**</span><span class="ruby-value">2</span>))
|
715
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
716
|
-
|
717
|
-
<span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">x</span> <span class="ruby-operator">/</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">call_count</span>)
|
718
|
-
<span class="ruby-keyword kw">end</span>
|
719
|
-
</pre>
|
720
|
-
</div>
|
721
|
-
</div>
|
722
|
-
</div>
|
723
|
-
|
724
|
-
<div id="method-M000016" class="method-detail">
|
725
|
-
<a name="M000016"></a>
|
726
|
-
|
727
|
-
<div class="method-heading">
|
728
|
-
<a href="#M000016" class="method-signature">
|
729
|
-
<span class="method-name">sum_merge!</span><span class="method-args">(other_stats)</span>
|
730
|
-
</a>
|
731
|
-
</div>
|
732
|
-
|
733
|
-
<div class="method-description">
|
734
|
-
<p>
|
735
|
-
<a href="Stats.html#M000018">merge</a> by adding to average response time
|
736
|
-
</p>
|
737
|
-
<ul>
|
738
|
-
<li>used to compose multiple metrics e.g. dispatcher time + mongrel queue time
|
739
|
-
|
740
|
-
</li>
|
741
|
-
</ul>
|
742
|
-
<p><a class="source-toggle" href="#"
|
743
|
-
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
744
|
-
<div class="method-source-code" id="M000016-source">
|
745
|
-
<pre>
|
746
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 32</span>
|
747
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sum_merge!</span> (<span class="ruby-identifier">other_stats</span>)
|
748
|
-
<span class="ruby-constant">Array</span>(<span class="ruby-identifier">other_stats</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
749
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">total_call_time</span>
|
750
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_exclusive_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">total_exclusive_time</span>
|
751
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min_call_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">min_call_time</span>
|
752
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_call_time</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">max_call_time</span>
|
753
|
-
<span class="ruby-comment cmt">#self.call_count += s.call_count - do not add call count because we are stacking these times on top of each other</span>
|
754
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sum_of_squares</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">sum_of_squares</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">sum_of_squares</span>
|
755
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">begin_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">begin_time</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">begin_time</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">begin_time</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">begin_time</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
756
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">end_time</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">end_time</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">end_time</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">></span> <span class="ruby-identifier">end_time</span>.<span class="ruby-identifier">to_f</span>
|
757
|
-
<span class="ruby-keyword kw">end</span>
|
758
|
-
|
759
|
-
<span class="ruby-keyword kw">self</span>
|
760
|
-
<span class="ruby-keyword kw">end</span>
|
761
|
-
</pre>
|
762
|
-
</div>
|
763
|
-
</div>
|
764
|
-
</div>
|
765
|
-
|
766
|
-
<div id="method-M000034" class="method-detail">
|
767
|
-
<a name="M000034"></a>
|
768
|
-
|
769
|
-
<div class="method-heading">
|
770
|
-
<a href="#M000034" class="method-signature">
|
771
|
-
<span class="method-name">summary</span><span class="method-args">()</span>
|
772
|
-
</a>
|
773
|
-
</div>
|
774
|
-
|
775
|
-
<div class="method-description">
|
776
|
-
<p>
|
777
|
-
Summary string to facilitate testing
|
778
|
-
</p>
|
779
|
-
<p><a class="source-toggle" href="#"
|
780
|
-
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
781
|
-
<div class="method-source-code" id="M000034-source">
|
782
|
-
<pre>
|
783
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 190</span>
|
784
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">summary</span>
|
785
|
-
<span class="ruby-identifier">format</span> = <span class="ruby-value str">"%m/%d %I:%M%p"</span>
|
786
|
-
<span class="ruby-node">"[#{Time.at(begin_time).strftime(format)}, #{'%2.3fs' % duration}; #{'%4i' % call_count} calls #{'%4i' % to_ms(average_call_time)} ms]"</span>
|
787
|
-
<span class="ruby-keyword kw">end</span>
|
788
|
-
</pre>
|
789
|
-
</div>
|
790
|
-
</div>
|
791
|
-
</div>
|
792
|
-
|
793
|
-
<div id="method-M000028" class="method-detail">
|
794
|
-
<a name="M000028"></a>
|
795
|
-
|
796
|
-
<div class="method-heading">
|
797
|
-
<a href="#M000028" class="method-signature">
|
798
|
-
<span class="method-name">time_percentage</span><span class="method-args">()</span>
|
799
|
-
</a>
|
800
|
-
</div>
|
801
|
-
|
802
|
-
<div class="method-description">
|
803
|
-
<p>
|
804
|
-
returns the time spent in this component as a percentage of the total time
|
805
|
-
window.
|
806
|
-
</p>
|
807
|
-
<p><a class="source-toggle" href="#"
|
808
|
-
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
809
|
-
<div class="method-source-code" id="M000028-source">
|
810
|
-
<pre>
|
811
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 163</span>
|
812
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">time_percentage</span>
|
813
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
814
|
-
<span class="ruby-identifier">total_call_time</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">duration</span>
|
815
|
-
<span class="ruby-keyword kw">end</span>
|
816
|
-
</pre>
|
817
|
-
</div>
|
818
|
-
</div>
|
819
|
-
</div>
|
820
|
-
|
821
|
-
<div id="method-M000013" class="method-detail">
|
822
|
-
<a name="M000013"></a>
|
823
|
-
|
824
|
-
<div class="method-heading">
|
825
|
-
<a href="#M000013" class="method-signature">
|
826
|
-
<span class="method-name">time_str</span><span class="method-args">(value_ms)</span>
|
827
|
-
</a>
|
828
|
-
</div>
|
829
|
-
|
830
|
-
<div class="method-description">
|
831
|
-
<p><a class="source-toggle" href="#"
|
832
|
-
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
833
|
-
<div class="method-source-code" id="M000013-source">
|
834
|
-
<pre>
|
835
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 10</span>
|
836
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">time_str</span>(<span class="ruby-identifier">value_ms</span>)
|
837
|
-
<span class="ruby-keyword kw">case</span>
|
838
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">value_ms</span> <span class="ruby-operator">>=</span> <span class="ruby-value">10000</span>
|
839
|
-
<span class="ruby-value str">"%.1f s"</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">value_ms</span> <span class="ruby-operator">/</span> <span class="ruby-value">1000.0</span>)
|
840
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">value_ms</span> <span class="ruby-operator">>=</span> <span class="ruby-value">5000</span>
|
841
|
-
<span class="ruby-value str">"%.2f s"</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">value_ms</span> <span class="ruby-operator">/</span> <span class="ruby-value">1000.0</span>)
|
842
|
-
<span class="ruby-keyword kw">else</span>
|
843
|
-
<span class="ruby-value str">"%.0f ms"</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">value_ms</span>
|
844
|
-
<span class="ruby-keyword kw">end</span>
|
845
|
-
<span class="ruby-keyword kw">end</span>
|
846
|
-
</pre>
|
847
|
-
</div>
|
848
|
-
</div>
|
849
|
-
</div>
|
850
|
-
|
851
|
-
<div id="method-M000033" class="method-detail">
|
852
|
-
<a name="M000033"></a>
|
853
|
-
|
854
|
-
<div class="method-heading">
|
855
|
-
<a href="#M000033" class="method-signature">
|
856
|
-
<span class="method-name">to_s</span><span class="method-args">()</span>
|
857
|
-
</a>
|
858
|
-
</div>
|
859
|
-
|
860
|
-
<div class="method-description">
|
861
|
-
<p><a class="source-toggle" href="#"
|
862
|
-
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
863
|
-
<div class="method-source-code" id="M000033-source">
|
864
|
-
<pre>
|
865
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 177</span>
|
866
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
867
|
-
<span class="ruby-identifier">s</span> = <span class="ruby-node">"Begin=#{begin_time}, "</span>
|
868
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Duration=#{duration} s, "</span>
|
869
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Count=#{call_count}, "</span>
|
870
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Total=#{to_ms(total_call_time)}, "</span>
|
871
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Total Exclusive=#{to_ms(total_exclusive_time)}, "</span>
|
872
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Avg=#{to_ms(average_call_time)}, "</span>
|
873
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Min=#{to_ms(min_call_time)}, "</span>
|
874
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Max=#{to_ms(max_call_time)}, "</span>
|
875
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"StdDev=#{to_ms(standard_deviation)}"</span>
|
876
|
-
<span class="ruby-keyword kw">end</span>
|
877
|
-
</pre>
|
878
|
-
</div>
|
879
|
-
</div>
|
880
|
-
</div>
|
881
|
-
|
882
|
-
<div id="method-M000026" class="method-detail">
|
883
|
-
<a name="M000026"></a>
|
884
|
-
|
885
|
-
<div class="method-heading">
|
886
|
-
<a href="#M000026" class="method-signature">
|
887
|
-
<span class="method-name">total_call_time_per_minute</span><span class="method-args">()</span>
|
888
|
-
</a>
|
889
|
-
</div>
|
890
|
-
|
891
|
-
<div class="method-description">
|
892
|
-
<p><a class="source-toggle" href="#"
|
893
|
-
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
894
|
-
<div class="method-source-code" id="M000026-source">
|
895
|
-
<pre>
|
896
|
-
<span class="ruby-comment cmt"># File lib/new_relic/stats.rb, line 146</span>
|
897
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">total_call_time_per_minute</span>
|
898
|
-
<span class="ruby-value">60.0</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">time_percentage</span>
|
899
|
-
<span class="ruby-keyword kw">end</span>
|
900
|
-
</pre>
|
901
|
-
</div>
|
902
|
-
</div>
|
903
|
-
</div>
|
904
|
-
|
905
|
-
|
906
|
-
</div>
|
907
|
-
|
908
|
-
|
909
|
-
</div>
|
910
|
-
|
911
|
-
|
912
|
-
<div id="validator-badges">
|
913
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
914
|
-
</div>
|
915
|
-
|
916
|
-
</body>
|
917
|
-
</html>
|