newrelic_rpm 2.8.0
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/LICENSE +37 -0
- data/README +93 -0
- data/Rakefile +38 -0
- data/install.rb +37 -0
- data/lib/new_relic/agent.rb +26 -0
- data/lib/new_relic/agent/agent.rb +762 -0
- data/lib/new_relic/agent/chained_call.rb +13 -0
- data/lib/new_relic/agent/collection_helper.rb +81 -0
- data/lib/new_relic/agent/error_collector.rb +105 -0
- data/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb +95 -0
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +151 -0
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +90 -0
- data/lib/new_relic/agent/instrumentation/dispatcher_instrumentation.rb +105 -0
- data/lib/new_relic/agent/instrumentation/memcache.rb +18 -0
- data/lib/new_relic/agent/instrumentation/merb/controller.rb +17 -0
- data/lib/new_relic/agent/instrumentation/merb/dispatcher.rb +15 -0
- data/lib/new_relic/agent/instrumentation/merb/errors.rb +6 -0
- data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +35 -0
- data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +27 -0
- data/lib/new_relic/agent/instrumentation/rails/dispatcher.rb +30 -0
- data/lib/new_relic/agent/instrumentation/rails/errors.rb +23 -0
- data/lib/new_relic/agent/instrumentation/rails/rails.rb +6 -0
- data/lib/new_relic/agent/method_tracer.rb +171 -0
- data/lib/new_relic/agent/patch_const_missing.rb +31 -0
- data/lib/new_relic/agent/samplers/cpu.rb +29 -0
- data/lib/new_relic/agent/samplers/memory.rb +55 -0
- data/lib/new_relic/agent/samplers/mongrel.rb +26 -0
- data/lib/new_relic/agent/stats_engine.rb +241 -0
- data/lib/new_relic/agent/synchronize.rb +40 -0
- data/lib/new_relic/agent/transaction_sampler.rb +281 -0
- data/lib/new_relic/agent/worker_loop.rb +128 -0
- data/lib/new_relic/api/deployments.rb +92 -0
- data/lib/new_relic/config.rb +194 -0
- data/lib/new_relic/config/merb.rb +35 -0
- data/lib/new_relic/config/rails.rb +113 -0
- data/lib/new_relic/config/ruby.rb +9 -0
- data/lib/new_relic/local_environment.rb +108 -0
- data/lib/new_relic/merbtasks.rb +6 -0
- data/lib/new_relic/metric_data.rb +26 -0
- data/lib/new_relic/metric_spec.rb +39 -0
- data/lib/new_relic/metrics.rb +7 -0
- data/lib/new_relic/noticed_error.rb +21 -0
- data/lib/new_relic/shim_agent.rb +95 -0
- data/lib/new_relic/stats.rb +359 -0
- data/lib/new_relic/transaction_analysis.rb +122 -0
- data/lib/new_relic/transaction_sample.rb +499 -0
- data/lib/new_relic/version.rb +111 -0
- data/lib/new_relic_api.rb +275 -0
- data/lib/newrelic_rpm.rb +27 -0
- data/lib/tasks/agent_tests.rake +14 -0
- data/lib/tasks/all.rb +4 -0
- data/lib/tasks/install.rake +7 -0
- data/newrelic.yml +137 -0
- data/recipes/newrelic.rb +46 -0
- data/test/config/newrelic.yml +26 -0
- data/test/config/test_config.rb +9 -0
- data/test/new_relic/agent/mock_ar_connection.rb +40 -0
- data/test/new_relic/agent/mock_scope_listener.rb +23 -0
- data/test/new_relic/agent/model_fixture.rb +17 -0
- data/test/new_relic/agent/tc_active_record.rb +91 -0
- data/test/new_relic/agent/tc_agent.rb +112 -0
- data/test/new_relic/agent/tc_collection_helper.rb +104 -0
- data/test/new_relic/agent/tc_controller.rb +98 -0
- data/test/new_relic/agent/tc_dispatcher_instrumentation.rb +52 -0
- data/test/new_relic/agent/tc_error_collector.rb +127 -0
- data/test/new_relic/agent/tc_method_tracer.rb +306 -0
- data/test/new_relic/agent/tc_stats_engine.rb +218 -0
- data/test/new_relic/agent/tc_synchronize.rb +37 -0
- data/test/new_relic/agent/tc_transaction_sample.rb +175 -0
- data/test/new_relic/agent/tc_transaction_sample_builder.rb +200 -0
- data/test/new_relic/agent/tc_transaction_sampler.rb +305 -0
- data/test/new_relic/agent/tc_worker_loop.rb +101 -0
- data/test/new_relic/agent/testable_agent.rb +13 -0
- data/test/new_relic/tc_config.rb +36 -0
- data/test/new_relic/tc_deployments_api.rb +37 -0
- data/test/new_relic/tc_environment.rb +94 -0
- data/test/new_relic/tc_metric_spec.rb +150 -0
- data/test/new_relic/tc_shim_agent.rb +9 -0
- data/test/new_relic/tc_stats.rb +141 -0
- data/test/test_helper.rb +39 -0
- data/test/ui/tc_newrelic_helper.rb +44 -0
- data/ui/controllers/newrelic_controller.rb +200 -0
- data/ui/helpers/google_pie_chart.rb +55 -0
- data/ui/helpers/newrelic_helper.rb +286 -0
- data/ui/views/layouts/newrelic_default.rhtml +49 -0
- data/ui/views/newrelic/_explain_plans.rhtml +27 -0
- data/ui/views/newrelic/_sample.rhtml +12 -0
- data/ui/views/newrelic/_segment.rhtml +28 -0
- data/ui/views/newrelic/_segment_row.rhtml +14 -0
- data/ui/views/newrelic/_show_sample_detail.rhtml +22 -0
- data/ui/views/newrelic/_show_sample_sql.rhtml +19 -0
- data/ui/views/newrelic/_show_sample_summary.rhtml +3 -0
- data/ui/views/newrelic/_sql_row.rhtml +11 -0
- data/ui/views/newrelic/_stack_trace.rhtml +30 -0
- data/ui/views/newrelic/_table.rhtml +12 -0
- data/ui/views/newrelic/explain_sql.rhtml +45 -0
- data/ui/views/newrelic/images/arrow-close.png +0 -0
- data/ui/views/newrelic/images/arrow-open.png +0 -0
- data/ui/views/newrelic/images/blue_bar.gif +0 -0
- data/ui/views/newrelic/images/gray_bar.gif +0 -0
- data/ui/views/newrelic/index.rhtml +37 -0
- data/ui/views/newrelic/javascript/transaction_sample.js +107 -0
- data/ui/views/newrelic/sample_not_found.rhtml +2 -0
- data/ui/views/newrelic/show_sample.rhtml +62 -0
- data/ui/views/newrelic/show_source.rhtml +3 -0
- data/ui/views/newrelic/stylesheets/style.css +394 -0
- metadata +180 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
<script type="text/javascript" src="<%= url_for(:controller => :newrelic, :action => :javascript, :file => 'transaction_sample.js') %>"></script>
|
2
|
+
<div id='summary_table'>
|
3
|
+
<table class="light_background">
|
4
|
+
<tr>
|
5
|
+
<th>URL:</th>
|
6
|
+
<td><%= @sample.params[:uri]%></td>
|
7
|
+
</tr>
|
8
|
+
<tr>
|
9
|
+
<th>Controller:</th>
|
10
|
+
<td><%= @sample_controller_name%></td>
|
11
|
+
</tr>
|
12
|
+
<tr>
|
13
|
+
<th>Action:</th>
|
14
|
+
<td><%= @sample_action_name%></td>
|
15
|
+
</tr>
|
16
|
+
<tr>
|
17
|
+
<th>Start Time:</th>
|
18
|
+
<td><%= format_timestamp(@sample.start_time) %></td>
|
19
|
+
</tr>
|
20
|
+
<tr>
|
21
|
+
<th>Duration:</th>
|
22
|
+
<td><%= colorize(@sample.duration, 1, 2) %> ms</td>
|
23
|
+
</tr>
|
24
|
+
<tr>
|
25
|
+
<th>CPU Burn:</th>
|
26
|
+
<td><%= @sample.params[:cpu_time].to_ms if @sample.params[:cpu_time] %> ms</td>
|
27
|
+
</tr>
|
28
|
+
<% unless @request_params.empty? %>
|
29
|
+
<tr>
|
30
|
+
<th valign="top">Params:</th>
|
31
|
+
<td>
|
32
|
+
<%= link_to_function("#{@request_params.length}...", "show_request_params()", :id => "params_link") %>
|
33
|
+
|
34
|
+
<div id='request_params' style="display: none;">
|
35
|
+
<small>
|
36
|
+
<% @request_params.each do |k,v| %>
|
37
|
+
<b> <%= k %>: </b><%=v%><br/>
|
38
|
+
<% end %>
|
39
|
+
</small>
|
40
|
+
</div>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
<% end %>
|
44
|
+
</table>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<br/>
|
48
|
+
<div id="view_sample">
|
49
|
+
<div align=center width="100%">
|
50
|
+
<%= show_view_link 'Summary', 'show_sample_summary' %>
|
51
|
+
<%= show_view_link 'Details', 'show_sample_detail' %>
|
52
|
+
<%= show_view_link 'SQL', 'show_sample_sql' %>
|
53
|
+
</div>
|
54
|
+
<br/>
|
55
|
+
|
56
|
+
<%= %w[show_sample_summary show_sample_sql show_sample_detail].collect do |p|
|
57
|
+
options = {:align => 'center', :id => p}
|
58
|
+
options[:style] = 'display: none' unless p == params[:action]
|
59
|
+
content_tag('div', render(:partial => p), options)
|
60
|
+
end.join(' ')%>
|
61
|
+
|
62
|
+
</div>
|
@@ -0,0 +1,394 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
/*
|
4
|
+
Originally based on the theme credited below.
|
5
|
+
Tweaks by Lew Cirne for Seldon
|
6
|
+
|
7
|
+
Theme Name: Simpla
|
8
|
+
Theme URI: http://ifelse.co.uk/simpla/
|
9
|
+
Description: A clean, minimalist theme
|
10
|
+
Version: 1.01
|
11
|
+
Author: Phu Ly
|
12
|
+
Author URI: http://ifelse.co.uk/
|
13
|
+
*/
|
14
|
+
|
15
|
+
/*************************************
|
16
|
+
+Containers
|
17
|
+
*************************************/
|
18
|
+
body{
|
19
|
+
color:#333;
|
20
|
+
min-width: 1004px;
|
21
|
+
font-family: "Lucida Grande","Lucida Sans Unicode", Verdana, Tahoma, Arial, Helvetica, sans-serif;
|
22
|
+
font-size:12px;
|
23
|
+
margin:0;
|
24
|
+
padding:0;
|
25
|
+
text-align:center;
|
26
|
+
}
|
27
|
+
#wrap{
|
28
|
+
margin:0 auto;
|
29
|
+
text-align:left;
|
30
|
+
width:76em;
|
31
|
+
}
|
32
|
+
#content{
|
33
|
+
width: 984px;
|
34
|
+
margin: 10px auto;
|
35
|
+
text-align:left;
|
36
|
+
}
|
37
|
+
#header{
|
38
|
+
padding: 0px;
|
39
|
+
}
|
40
|
+
#footer
|
41
|
+
{
|
42
|
+
color:#888;
|
43
|
+
clear:both;
|
44
|
+
font-size:smaller;
|
45
|
+
padding-top: 15px;
|
46
|
+
text-align: left;
|
47
|
+
}
|
48
|
+
#footer p
|
49
|
+
{
|
50
|
+
margin-left: 15px;
|
51
|
+
margin-top: 10px;
|
52
|
+
}
|
53
|
+
|
54
|
+
/*************************************
|
55
|
+
Navigation Bar (horizontal at top)
|
56
|
+
*************************************/
|
57
|
+
#navbar{
|
58
|
+
color:#00A;
|
59
|
+
font-size:1.2em;
|
60
|
+
}
|
61
|
+
|
62
|
+
/*************************************
|
63
|
+
+Hn and p
|
64
|
+
*************************************/
|
65
|
+
h1, h2, h3, p
|
66
|
+
{
|
67
|
+
color:#333333;
|
68
|
+
}
|
69
|
+
|
70
|
+
h1, h2, h3
|
71
|
+
{
|
72
|
+
margin: 10px 0px 10px 0px;
|
73
|
+
font-weight: normal;
|
74
|
+
letter-spacing: 0px;
|
75
|
+
}
|
76
|
+
|
77
|
+
p
|
78
|
+
{
|
79
|
+
margin: 7px 0px 7px 0px;
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
#header h1{
|
84
|
+
font-size:1.2em;
|
85
|
+
font-weight:normal;
|
86
|
+
}
|
87
|
+
#header h1 a{
|
88
|
+
color:#E87830;
|
89
|
+
}
|
90
|
+
#header h1 a:hover{
|
91
|
+
color:#CC0000;
|
92
|
+
}
|
93
|
+
#header p{
|
94
|
+
font-size:1.1em;
|
95
|
+
margin:0;
|
96
|
+
margin-top:-0.1em;
|
97
|
+
margin-bottom:0.3em;
|
98
|
+
}
|
99
|
+
#header table
|
100
|
+
{
|
101
|
+
padding: 0px 0px 0px 0px;
|
102
|
+
}
|
103
|
+
|
104
|
+
/*************************************
|
105
|
+
+Misc
|
106
|
+
*************************************/
|
107
|
+
a{
|
108
|
+
color:#116677;
|
109
|
+
text-decoration:none;
|
110
|
+
}
|
111
|
+
a:hover{
|
112
|
+
color:#0055aa;
|
113
|
+
text-decoration:underline;
|
114
|
+
}
|
115
|
+
img{
|
116
|
+
border-style:none;
|
117
|
+
}
|
118
|
+
var{
|
119
|
+
font-family: Courier;
|
120
|
+
font-style: normal;
|
121
|
+
font-size: 1.1em;
|
122
|
+
}
|
123
|
+
|
124
|
+
/* regular tables use thead instead of th. th is only used by name/value table layouts */
|
125
|
+
th
|
126
|
+
{
|
127
|
+
padding: 5px 5px 5px 5px;
|
128
|
+
text-align: right;
|
129
|
+
}
|
130
|
+
/*************************************
|
131
|
+
+Seldon Specific - need to preserve
|
132
|
+
*************************************/
|
133
|
+
.light_background
|
134
|
+
{
|
135
|
+
background-color: #FAFEFE;
|
136
|
+
}
|
137
|
+
div.flash, #errorExplanation
|
138
|
+
{
|
139
|
+
margin: 8px 10px 8px 10px;
|
140
|
+
border: 2px;
|
141
|
+
border-style: solid;
|
142
|
+
}
|
143
|
+
|
144
|
+
div.flash
|
145
|
+
{
|
146
|
+
padding: 10px 5px 10px 20px;
|
147
|
+
}
|
148
|
+
|
149
|
+
#errorExplanation
|
150
|
+
{
|
151
|
+
padding: 5px 5px 5px 20px;
|
152
|
+
color: #bb0011;
|
153
|
+
}
|
154
|
+
|
155
|
+
div.flash.error
|
156
|
+
{
|
157
|
+
border-color: #bb0011;
|
158
|
+
color: #bb0011;
|
159
|
+
}
|
160
|
+
|
161
|
+
div.flash.notice
|
162
|
+
{
|
163
|
+
border-color: #eeaa33;
|
164
|
+
color: #eeaa33;
|
165
|
+
}
|
166
|
+
|
167
|
+
#metricsummary{
|
168
|
+
background:#ddd;
|
169
|
+
border-top:1px solid #777;
|
170
|
+
clear:both;
|
171
|
+
font-size:0.9em;
|
172
|
+
padding:0.5em;
|
173
|
+
}
|
174
|
+
|
175
|
+
.application_title
|
176
|
+
{
|
177
|
+
font-size: larger;
|
178
|
+
}
|
179
|
+
|
180
|
+
#navlist
|
181
|
+
{
|
182
|
+
font-size: smaller;
|
183
|
+
margin: 0px;
|
184
|
+
padding: 0px 10px 15px 0px;
|
185
|
+
white-space: nowrap;
|
186
|
+
color: #333333;
|
187
|
+
}
|
188
|
+
|
189
|
+
#navlist li
|
190
|
+
{
|
191
|
+
display: inline;
|
192
|
+
list-style-type: none;
|
193
|
+
padding: 0px 0px 0px 20px;
|
194
|
+
font-size: 12px;
|
195
|
+
color: #333333;
|
196
|
+
}
|
197
|
+
|
198
|
+
#navlist li a
|
199
|
+
{
|
200
|
+
color: #333333;
|
201
|
+
}
|
202
|
+
|
203
|
+
#secondary_nav
|
204
|
+
{
|
205
|
+
margin: 0px;
|
206
|
+
padding: 5px 5px 5px 5px;
|
207
|
+
}
|
208
|
+
|
209
|
+
#secondary_nav li
|
210
|
+
{
|
211
|
+
display: inline;
|
212
|
+
list-style-type: none;
|
213
|
+
padding: 0px 20px 0px 0px;
|
214
|
+
font-size: .9em;
|
215
|
+
}
|
216
|
+
|
217
|
+
#pie_chart_image
|
218
|
+
{
|
219
|
+
margin: 15px 0px 15px 0px;
|
220
|
+
}
|
221
|
+
|
222
|
+
.transaction_list_table
|
223
|
+
{
|
224
|
+
width: 600px;
|
225
|
+
margin-right: 15px;
|
226
|
+
}
|
227
|
+
|
228
|
+
.application_stack_trace, .full_stack_trace
|
229
|
+
{
|
230
|
+
font-family: monospace;
|
231
|
+
margin-top: 10px;
|
232
|
+
margin-left: 20px;
|
233
|
+
max-width: 950px;
|
234
|
+
overflow: auto;
|
235
|
+
}
|
236
|
+
|
237
|
+
#summary_table
|
238
|
+
{
|
239
|
+
}
|
240
|
+
|
241
|
+
.sql_statement
|
242
|
+
{
|
243
|
+
width: 800px;
|
244
|
+
overflow: auto;
|
245
|
+
}
|
246
|
+
|
247
|
+
.plan
|
248
|
+
{
|
249
|
+
font-family: monospace;
|
250
|
+
font-size: 0.8em;
|
251
|
+
white-space: pre;
|
252
|
+
}
|
253
|
+
#page_nav
|
254
|
+
{
|
255
|
+
height: 42px;
|
256
|
+
}
|
257
|
+
|
258
|
+
#page_nav tr
|
259
|
+
{
|
260
|
+
vertical-align: middle;
|
261
|
+
}
|
262
|
+
|
263
|
+
#page_nav td
|
264
|
+
{
|
265
|
+
padding-left: 20px;
|
266
|
+
color:#333;
|
267
|
+
white-space: nowrap;
|
268
|
+
}
|
269
|
+
|
270
|
+
|
271
|
+
table
|
272
|
+
{
|
273
|
+
font-size: 12px;
|
274
|
+
border-collapse: collapse;
|
275
|
+
border-spacing: 0px;
|
276
|
+
padding: 5px 5px 5px 5px;
|
277
|
+
}
|
278
|
+
|
279
|
+
|
280
|
+
thead
|
281
|
+
{
|
282
|
+
text-align:left;
|
283
|
+
font-weight: normal;
|
284
|
+
line-height:100%;
|
285
|
+
background-color: #6688aa;
|
286
|
+
color: white;
|
287
|
+
padding: 5px 5px 5px 5px;
|
288
|
+
}
|
289
|
+
|
290
|
+
tfoot
|
291
|
+
{
|
292
|
+
background-color: #6688aa;
|
293
|
+
color: #333;
|
294
|
+
}
|
295
|
+
|
296
|
+
tfoot td
|
297
|
+
{
|
298
|
+
font-size: smaller;
|
299
|
+
text-align:right;
|
300
|
+
}
|
301
|
+
|
302
|
+
td.title_bar_right
|
303
|
+
{
|
304
|
+
text-align:right;
|
305
|
+
font-size: 11px;
|
306
|
+
}
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
td.top_nav
|
311
|
+
{
|
312
|
+
text-align: right;
|
313
|
+
vertical-align: bottom;
|
314
|
+
padding: 0px 0px 0px 0px;
|
315
|
+
}
|
316
|
+
|
317
|
+
td.time_nav
|
318
|
+
{
|
319
|
+
text-align: right;
|
320
|
+
}
|
321
|
+
|
322
|
+
td
|
323
|
+
{
|
324
|
+
text-align: left;
|
325
|
+
padding: 5px 5px 5px 5px;
|
326
|
+
}
|
327
|
+
|
328
|
+
ul.tab_list {
|
329
|
+
list-style-type: none;
|
330
|
+
padding: 0;
|
331
|
+
}
|
332
|
+
|
333
|
+
ul.tab_list li {
|
334
|
+
padding-left: 1em;
|
335
|
+
}
|
336
|
+
.selected {
|
337
|
+
background: url(/newrelic/image?file=arrow-close.png) no-repeat;
|
338
|
+
}
|
339
|
+
|
340
|
+
.expand {
|
341
|
+
background-image:url(/newrelic/image?file=arrow-open.png);
|
342
|
+
width:16px;
|
343
|
+
background-position: top left;
|
344
|
+
padding-left: 20px;
|
345
|
+
background-repeat:no-repeat;
|
346
|
+
text-decoration: none;
|
347
|
+
}
|
348
|
+
|
349
|
+
.collapse {
|
350
|
+
background-image:url(/newrelic/image?file=arrow-close.png);
|
351
|
+
text-decoration: none;
|
352
|
+
width:16px;
|
353
|
+
padding-left: 20px;
|
354
|
+
background-position: top left;
|
355
|
+
background-repeat:no-repeat;
|
356
|
+
}
|
357
|
+
|
358
|
+
|
359
|
+
.clock {
|
360
|
+
margin-bottom: -5px;
|
361
|
+
}
|
362
|
+
|
363
|
+
.selected_source_line {
|
364
|
+
background: #bdf
|
365
|
+
}
|
366
|
+
|
367
|
+
.scrolling_container {
|
368
|
+
overflow: auto;
|
369
|
+
padding-left: 5px;
|
370
|
+
max-height: 150px;
|
371
|
+
border: 1px solid #898989;
|
372
|
+
}
|
373
|
+
|
374
|
+
.odd_row {
|
375
|
+
background-color: #eeeeee;
|
376
|
+
}
|
377
|
+
|
378
|
+
.even_row {
|
379
|
+
background-color: #ffffff;
|
380
|
+
}
|
381
|
+
|
382
|
+
.leaf_segment
|
383
|
+
{
|
384
|
+
padding-left: 20px;
|
385
|
+
}
|
386
|
+
|
387
|
+
.help
|
388
|
+
{
|
389
|
+
padding: 10px 5px 5px 5px;
|
390
|
+
}
|
391
|
+
|
392
|
+
.help p
|
393
|
+
{
|
394
|
+
}
|