newrelic_rpm 2.12.3 → 2.13.0.beta3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of newrelic_rpm might be problematic. Click here for more details.

Files changed (118) hide show
  1. data/CHANGELOG +24 -2
  2. data/README.rdoc +172 -0
  3. data/bin/newrelic +13 -0
  4. data/bin/newrelic_cmd +2 -1
  5. data/install.rb +8 -45
  6. data/lib/new_relic/agent.rb +43 -30
  7. data/lib/new_relic/agent/agent.rb +699 -631
  8. data/lib/new_relic/agent/busy_calculator.rb +81 -81
  9. data/lib/new_relic/agent/error_collector.rb +9 -6
  10. data/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb +2 -2
  11. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +10 -5
  12. data/lib/new_relic/agent/instrumentation/data_mapper.rb +13 -45
  13. data/lib/new_relic/agent/instrumentation/memcache.rb +15 -4
  14. data/lib/new_relic/agent/instrumentation/metric_frame.rb +37 -29
  15. data/lib/new_relic/agent/instrumentation/rack.rb +20 -34
  16. data/lib/new_relic/agent/method_tracer.rb +9 -9
  17. data/lib/new_relic/agent/samplers/delayed_job_lock_sampler.rb +31 -31
  18. data/lib/new_relic/agent/stats_engine/metric_stats.rb +5 -5
  19. data/lib/new_relic/agent/stats_engine/samplers.rb +3 -0
  20. data/lib/new_relic/agent/transaction_sampler.rb +31 -15
  21. data/lib/new_relic/agent/worker_loop.rb +29 -28
  22. data/lib/new_relic/collection_helper.rb +4 -2
  23. data/lib/new_relic/command.rb +85 -0
  24. data/lib/new_relic/commands/deployments.rb +74 -114
  25. data/lib/new_relic/commands/install.rb +81 -0
  26. data/lib/new_relic/control.rb +54 -379
  27. data/lib/new_relic/control/configuration.rb +149 -0
  28. data/lib/new_relic/control/{external.rb → frameworks/external.rb} +2 -2
  29. data/lib/new_relic/control/{merb.rb → frameworks/merb.rb} +1 -1
  30. data/lib/new_relic/control/frameworks/rails.rb +126 -0
  31. data/lib/new_relic/control/{rails3.rb → frameworks/rails3.rb} +11 -10
  32. data/lib/new_relic/control/{ruby.rb → frameworks/ruby.rb} +1 -1
  33. data/lib/new_relic/control/{sinatra.rb → frameworks/sinatra.rb} +2 -2
  34. data/lib/new_relic/control/instrumentation.rb +84 -0
  35. data/lib/new_relic/control/logging_methods.rb +74 -0
  36. data/lib/new_relic/control/profiling.rb +24 -0
  37. data/lib/new_relic/control/server_methods.rb +88 -0
  38. data/lib/new_relic/local_environment.rb +3 -3
  39. data/lib/new_relic/metric_parser.rb +13 -2
  40. data/lib/new_relic/metric_parser/active_record.rb +4 -1
  41. data/lib/new_relic/metric_parser/apdex.rb +53 -0
  42. data/lib/new_relic/metric_parser/controller.rb +13 -5
  43. data/lib/new_relic/metric_parser/mem_cache.rb +1 -1
  44. data/lib/new_relic/metric_parser/other_transaction.rb +21 -0
  45. data/lib/new_relic/metric_spec.rb +3 -3
  46. data/lib/new_relic/noticed_error.rb +1 -1
  47. data/lib/new_relic/rack/developer_mode.rb +257 -0
  48. data/lib/new_relic/rack/metric_app.rb +56 -50
  49. data/lib/new_relic/rack/mongrel_rpm.ru +7 -6
  50. data/lib/new_relic/rack/newrelic.yml +4 -3
  51. data/lib/new_relic/rack_app.rb +2 -1
  52. data/lib/new_relic/recipes.rb +7 -7
  53. data/lib/new_relic/stats.rb +6 -14
  54. data/lib/new_relic/timer_lib.rb +27 -0
  55. data/lib/new_relic/transaction_analysis.rb +2 -7
  56. data/lib/new_relic/transaction_sample.rb +17 -85
  57. data/lib/new_relic/url_rule.rb +14 -0
  58. data/lib/new_relic/version.rb +3 -3
  59. data/lib/newrelic_rpm.rb +5 -9
  60. data/newrelic.yml +26 -9
  61. data/newrelic_rpm.gemspec +67 -32
  62. data/test/config/newrelic.yml +5 -0
  63. data/test/config/test_control.rb +6 -8
  64. data/test/new_relic/agent/active_record_instrumentation_test.rb +5 -6
  65. data/test/new_relic/agent/agent_controller_test.rb +18 -4
  66. data/test/new_relic/agent/agent_test_controller.rb +1 -6
  67. data/test/new_relic/agent/busy_calculator_test.rb +2 -0
  68. data/test/new_relic/agent/collection_helper_test.rb +6 -6
  69. data/test/new_relic/agent/error_collector_test.rb +13 -21
  70. data/test/new_relic/agent/metric_data_test.rb +3 -6
  71. data/test/new_relic/agent/rpm_agent_test.rb +121 -117
  72. data/test/new_relic/agent/task_instrumentation_test.rb +128 -133
  73. data/test/new_relic/agent/transaction_sample_test.rb +176 -170
  74. data/test/new_relic/agent/worker_loop_test.rb +24 -18
  75. data/test/new_relic/control_test.rb +13 -3
  76. data/test/new_relic/deployments_api_test.rb +7 -7
  77. data/test/new_relic/environment_test.rb +1 -1
  78. data/test/new_relic/metric_parser_test.rb +58 -4
  79. data/test/new_relic/rack/episodes_test.rb +317 -0
  80. data/test/new_relic/stats_test.rb +3 -2
  81. data/test/test_contexts.rb +28 -0
  82. data/test/test_helper.rb +24 -5
  83. data/ui/helpers/{newrelic_helper.rb → developer_mode_helper.rb} +63 -23
  84. data/ui/views/layouts/newrelic_default.rhtml +6 -6
  85. data/ui/views/newrelic/_explain_plans.rhtml +4 -4
  86. data/ui/views/newrelic/_sample.rhtml +18 -17
  87. data/ui/views/newrelic/_segment.rhtml +1 -0
  88. data/ui/views/newrelic/_segment_row.rhtml +8 -8
  89. data/ui/views/newrelic/_show_sample_detail.rhtml +1 -1
  90. data/ui/views/newrelic/_show_sample_sql.rhtml +2 -2
  91. data/ui/views/newrelic/_sql_row.rhtml +8 -3
  92. data/ui/views/newrelic/_stack_trace.rhtml +9 -24
  93. data/ui/views/newrelic/_table.rhtml +1 -1
  94. data/ui/views/newrelic/explain_sql.rhtml +3 -2
  95. data/ui/views/newrelic/{images → file/images}/arrow-close.png +0 -0
  96. data/ui/views/newrelic/{images → file/images}/arrow-open.png +0 -0
  97. data/ui/views/newrelic/{images → file/images}/blue_bar.gif +0 -0
  98. data/ui/views/newrelic/{images → file/images}/file_icon.png +0 -0
  99. data/ui/views/newrelic/{images → file/images}/gray_bar.gif +0 -0
  100. data/ui/views/newrelic/{images → file/images}/new-relic-rpm-desktop.gif +0 -0
  101. data/ui/views/newrelic/{images → file/images}/new_relic_rpm_desktop.gif +0 -0
  102. data/ui/views/newrelic/{images → file/images}/textmate.png +0 -0
  103. data/ui/views/newrelic/file/javascript/jquery-1.4.2.js +6240 -0
  104. data/ui/views/newrelic/file/javascript/transaction_sample.js +120 -0
  105. data/ui/views/newrelic/{stylesheets → file/stylesheets}/style.css +0 -0
  106. data/ui/views/newrelic/index.rhtml +7 -5
  107. data/ui/views/newrelic/sample_not_found.rhtml +1 -1
  108. data/ui/views/newrelic/show_sample.rhtml +5 -6
  109. metadata +92 -34
  110. data/README.md +0 -138
  111. data/lib/new_relic/commands/new_relic_commands.rb +0 -30
  112. data/lib/new_relic/control/rails.rb +0 -151
  113. data/test/new_relic/agent/mock_ar_connection.rb +0 -40
  114. data/test/ui/newrelic_controller_test.rb +0 -14
  115. data/test/ui/newrelic_helper_test.rb +0 -53
  116. data/ui/controllers/newrelic_controller.rb +0 -220
  117. data/ui/views/newrelic/javascript/prototype-scriptaculous.js +0 -7288
  118. data/ui/views/newrelic/javascript/transaction_sample.js +0 -107
@@ -1,3 +1,4 @@
1
+ ENV['SKIP_RAILS'] = 'true'
1
2
  require File.expand_path(File.join(File.dirname(__FILE__),'..', 'test_helper'))
2
3
  ##require "new_relic/stats"
3
4
 
@@ -28,7 +29,7 @@ class NewRelic::StatsTest < Test::Unit::TestCase
28
29
  def test_to_s
29
30
  s1 = NewRelic::MethodTraceStats.new
30
31
  s1.trace_call 10
31
- assert_equal(s1.to_s, "Begin=0.0, Duration=0.0 s, Count=1, Total=10000, Total Exclusive=10000, Avg=10000, Min=10000, Max=10000, StdDev=0")
32
+ assert_equal("[01/01/70 12:00AM UTC, 0.000s; 1 calls 10000 ms]", s1.to_s)
32
33
  end
33
34
 
34
35
  def test_time_str
@@ -60,7 +61,7 @@ class NewRelic::StatsTest < Test::Unit::TestCase
60
61
  def test_multiply_by
61
62
  s1 = NewRelic::MethodTraceStats.new
62
63
  s1.trace_call 10
63
- assert_equal(s1.multiply_by(10).to_s, "Begin=0.0, Duration=0.0 s, Count=10, Total=100000, Total Exclusive=10000, Avg=10000, Min=10000, Max=10000, StdDev=0")
64
+ assert_equal("[01/01/70 12:00AM UTC, 0.000s; 10 calls 10000 ms]", s1.multiply_by(10).to_s)
64
65
  end
65
66
 
66
67
  def test_get_apdex
@@ -0,0 +1,28 @@
1
+
2
+ module TestContexts
3
+ def with_running_agent
4
+
5
+ context 'with running agent' do # this is needed for the nested setups
6
+
7
+ setup do
8
+ @log_data = StringIO.new
9
+ @log = Logger.new(@log_data)
10
+ NewRelic::Agent.manual_start :log => @log
11
+ @agent = NewRelic::Agent.instance
12
+ @agent.transaction_sampler.send :clear_builder
13
+ @agent.transaction_sampler.reset!
14
+ @agent.stats_engine.clear_stats
15
+ end
16
+
17
+ yield
18
+
19
+ def teardown
20
+ NewRelic::Agent.shutdown
21
+ @log_data.reset
22
+ NewRelic::Control.instance['dispatcher']=nil
23
+ NewRelic::Control.instance['dispatcher_instance_id']=nil
24
+ end
25
+
26
+ end
27
+ end
28
+ end
data/test/test_helper.rb CHANGED
@@ -1,16 +1,35 @@
1
1
  module NewRelic; TEST = true; end unless defined? NewRelic::TEST
2
- #ENV['NEWRELIC_ENABLE'] = 'true'
3
2
  ENV['RAILS_ENV'] = 'test'
4
3
  NEWRELIC_PLUGIN_DIR = File.expand_path(File.join(File.dirname(__FILE__),".."))
5
4
  $LOAD_PATH << File.join(NEWRELIC_PLUGIN_DIR,"test")
6
5
  $LOAD_PATH << File.join(NEWRELIC_PLUGIN_DIR,"ui/helpers")
7
6
  $LOAD_PATH.uniq!
8
7
 
9
- require File.expand_path(File.join(NEWRELIC_PLUGIN_DIR, "..","..","..","config","environment"))
10
-
11
- require 'test_help'
12
- require 'mocha'
8
+ require 'rubygems'
9
+ # We can speed things up in tests that don't need to load rails.
10
+ # You can also run the tests in a mode without rails. Many tests
11
+ # will be skipped.
12
+ if ENV['SKIP_RAILS']
13
+ dirs = File.dirname(__FILE__).split('/')
14
+ while dirs.any? && !File.directory?((dirs+%w[log]).join('/'))
15
+ dirs.pop
16
+ end
17
+ RAILS_ROOT = dirs.any? ? dirs.join("/") : "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
18
+ $LOAD_PATH << File.join(NEWRELIC_PLUGIN_DIR, "lib")
19
+ require File.join(NEWRELIC_PLUGIN_DIR, "lib/newrelic_rpm")
20
+ else
21
+ begin
22
+ require File.expand_path("../../../config/environment", NEWRELIC_PLUGIN_DIR)
23
+ require 'test_help'
24
+ rescue LoadError
25
+ puts "Unable to load Rails for New Relic tests: try setting the environment variable SKIP_RAILS=false"
26
+ raise
27
+ end
28
+ end
13
29
  require 'test/unit'
30
+ require 'mocha'
31
+ require 'shoulda'
32
+ require 'test_contexts'
14
33
 
15
34
  def assert_between(floor, ceiling, value, message = nil)
16
35
  assert floor <= value && value <= ceiling,
@@ -1,6 +1,9 @@
1
1
  require 'pathname'
2
- module NewrelicHelper
2
+ require File.expand_path('../google_pie_chart', __FILE__)
3
+ module NewRelic::DeveloperModeHelper
3
4
  include NewRelic::CollectionHelper
5
+
6
+ private
4
7
 
5
8
  # return the host that serves static content (css, metric documentation, images, etc)
6
9
  # that supports the desktop edition.
@@ -47,9 +50,13 @@ module NewrelicHelper
47
50
  def render_backtrace
48
51
  if @segment[:backtrace]
49
52
  content_tag('h3', 'Application Stack Trace') +
50
- render(:partial => agent_views_path('stack_trace'), :locals => {:segment => @segment})
53
+ render(:partial => 'stack_trace')
51
54
  end
52
55
  end
56
+
57
+ def h(text)
58
+ text
59
+ end
53
60
 
54
61
  def agent_views_path(path)
55
62
  path
@@ -75,7 +82,7 @@ module NewrelicHelper
75
82
  if using_textmate?
76
83
  "txmt://open?url=file://#{file}&line=#{line}"
77
84
  else
78
- url_for :action => 'show_source', :file => file, :line => line, :anchor => 'selected_line'
85
+ "show_source?file=#{file}&amp;line=#{line}&amp;anchor=selected_line"
79
86
  end
80
87
  end
81
88
 
@@ -88,7 +95,7 @@ module NewrelicHelper
88
95
  if source_available && segment[:backtrace] && (source_url = url_for_source(application_caller(segment[:backtrace])))
89
96
  link_to dev_name(segment.metric_name), source_url
90
97
  else
91
- h(dev_name(segment.metric_name))
98
+ dev_name(segment.metric_name)
92
99
  end
93
100
  end
94
101
 
@@ -102,14 +109,14 @@ module NewrelicHelper
102
109
  end
103
110
 
104
111
  def write_stack_trace_line(trace_line)
105
- link_to h(trace_line), url_for_source(trace_line)
112
+ link_to trace_line, url_for_source(trace_line)
106
113
  end
107
114
 
108
115
  # write a link to the source for a trace
109
116
  def link_to_source(trace)
110
- image_url = url_for(:controller => :newrelic, :action => :file, :file => (using_textmate? ? "textmate.png" : "file_icon.png"))
117
+ image_url = 'file/images/' + (using_textmate? ? "textmate.png" : "file_icon.png")
111
118
 
112
- link_to image_tag(image_url, :alt => (title = 'View Source'), :title => title), url_for_source(application_caller(trace))
119
+ link_to "<img src=#{image_url} alt=\"View Source\" title=\"View Source\"/>", url_for_source(application_caller(trace))
113
120
  end
114
121
 
115
122
  # print the formatted timestamp for a segment
@@ -131,17 +138,15 @@ module NewrelicHelper
131
138
  end
132
139
 
133
140
  def expanded_image_path()
134
- url_for(:controller => :newrelic, :action => :file, :file => 'arrow-open.png')
141
+ '/newrelic/file/images/arrow-open.png'
135
142
  end
136
143
 
137
144
  def collapsed_image_path()
138
- url_for(:controller => :newrelic, :action => :file, :file => 'arrow-close.png')
145
+ '/newrelic/file/images/arrow-close.png'
139
146
  end
140
147
 
141
148
  def explain_sql_url(segment)
142
- url_for(:action => :explain_sql,
143
- :id => @sample.sample_id,
144
- :segment => segment.segment_id)
149
+ "explain_sql?id=#{@sample.sample_id}&amp;segment=#{segment.segment_id}"
145
150
  end
146
151
 
147
152
  def segment_duration_value(segment)
@@ -149,7 +154,7 @@ module NewrelicHelper
149
154
  end
150
155
 
151
156
  def line_wrap_sql(sql)
152
- h(sql.gsub(/\,/,', ').squeeze(' ')) if sql
157
+ sql.gsub(/\,/,', ').squeeze(' ') if sql
153
158
  end
154
159
 
155
160
  def render_sample_details(sample)
@@ -158,7 +163,7 @@ module NewrelicHelper
158
163
  first_segment = sample.root_segment.called_segments.first
159
164
 
160
165
  # render the segments, then the css classes to indent them
161
- render_segment_details(first_segment) + render_indentation_classes(@indentation_depth)
166
+ render_segment_details(first_segment).to_s + render_indentation_classes(@indentation_depth).to_s
162
167
  end
163
168
 
164
169
  # the rows logger plugin disables the sql tracing functionality of the NewRelic agent -
@@ -171,10 +176,7 @@ module NewrelicHelper
171
176
  if depth > 0
172
177
  if !segment.called_segments.empty?
173
178
  row_class =segment_child_row_class(segment)
174
- link_to_function(tag('img', :src => collapsed_image_path, :id => "image_#{row_class}",
175
- :class_for_children => row_class,
176
- :class => (!segment.called_segments.empty?) ? 'parent_segment_image' : 'child_segment_image'),
177
- "toggle_row_class(this)")
179
+ link_to_function("<img src=\"#{collapsed_image_path}\" id=\"image_#{row_class}\" class_for_children=\"#{row_class}\" class=\"#{(!segment.called_segments.empty?) ? 'parent_segment_image' : 'child_segment_image'}\"", "toggle_row_class(this)")
178
180
  end
179
181
  end
180
182
  end
@@ -218,16 +220,16 @@ module NewrelicHelper
218
220
  end
219
221
 
220
222
  def explain_sql_link(segment, child_sql = false)
221
- link_to 'SQL', explain_sql_url(segment), sql_link_mouseover_options(segment)
223
+ link_to 'SQL', explain_sql_url(segment)+ '"' + sql_link_mouseover_options(segment).map {|k,v| "#{k}=\"#{v}\""}.join(' ')+ 'fake=\"'
222
224
  end
223
225
 
224
226
  def explain_sql_links(segment)
225
- if segment[:sql_obfuscated] || segment[:sql]
227
+ if segment[:sql]
226
228
  explain_sql_link segment
227
229
  else
228
230
  links = []
229
231
  segment.called_segments.each do |child|
230
- if child[:sql_obfuscated] || child[:sql]
232
+ if child[:sql]
231
233
  links << explain_sql_link(child, true)
232
234
  end
233
235
  end
@@ -257,7 +259,7 @@ module NewrelicHelper
257
259
  html = ''
258
260
  else
259
261
  repeat = segment.parent_segment.detail_segments.length if segment.parent_segment.is_a?(NewRelic::TransactionSample::CompositeSegment)
260
- html = render(:partial => agent_views_path('segment'), :object => segment, :locals => {:indent => depth, :repeat => repeat})
262
+ html = render(:partial => 'segment', :object => [segment, depth, repeat])
261
263
  depth += 1
262
264
  end
263
265
 
@@ -286,8 +288,46 @@ module NewrelicHelper
286
288
  def show_view_link(title, page_name)
287
289
  link_to_function("[#{title}]", "show_view('#{page_name}')");
288
290
  end
291
+
292
+
293
+ def link_to(name, location)
294
+ location = "/newrelic/#{location}" unless /:\/\// =~ location
295
+ "<a href=\"#{location}\">#{name}</a>"
296
+ end
297
+
298
+ def link_to_if(predicate, text, location="")
299
+ if predicate
300
+ link_to(text, location)
301
+ else
302
+ text
303
+ end
304
+ end
305
+
306
+ def link_to_unless_current(text, hash)
307
+ unless params[hash.keys[0].to_s]
308
+ link_to(text,"?#{hash.keys[0]}=#{hash.values[0]}")
309
+ else
310
+ text
311
+ end
312
+ end
313
+
314
+ def cycle(even, odd)
315
+ @cycle ||= 'a'
316
+ if @cycle == 'a'
317
+ @cycle = 'b'
318
+ even
319
+ else
320
+ @cycle = 'a'
321
+ odd
322
+ end
323
+ end
324
+
325
+ def link_to_function(title, javascript)
326
+ "<a href=\"#\" onclick=\"#{javascript}; return false;\">#{title}</a>"
327
+ end
328
+
289
329
  def mime_type_from_extension(extension)
290
- extension = extension[/[^.]*$/].downcase
330
+ extension = extension[/[^.]*$/].dncase
291
331
  case extension
292
332
  when 'png'; 'image/png'
293
333
  when 'gif'; 'image/gif'
@@ -1,18 +1,18 @@
1
1
  <html xmlns="http://www.w3.org/1999/xhtml"
2
2
  xml:lang="en" lang="en">
3
3
  <head>
4
- <script type="text/javascript" src="<%= url_for(:controller => :newrelic, :action => :file, :file => 'prototype-scriptaculous.js') %>"></script>
4
+ <script type="text/javascript" src="/newrelic/file/javascript/jquery-1.4.2.js"></script>
5
5
  <title>New Relic RPM Developer Mode</title>
6
- <link href="<%= url_for(:controller => :newrelic, :action => :file, :file => 'style.css') %>"
6
+ <link href="/newrelic/file/stylesheets/style.css"
7
7
  media="screen" rel="stylesheet" type="text/css" />
8
8
  </head>
9
9
  <body>
10
10
  <div id="header">
11
- <img width="100%" height="4" src="<%= url_for(:controller => :newrelic, :action => :file, :file => 'blue_bar.gif') %>" alt="spacer"/>
11
+ <img width="100%" height="4" src="/newrelic/file/images/blue_bar.gif" alt="spacer"/>
12
12
  <table width="100%" height="60">
13
13
  <tr>
14
14
  <td valign="middle">
15
- <a href='/newrelic'><img src="<%= url_for(:controller => :newrelic, :action => :file, :file => 'new_relic_rpm_desktop.gif') %>" hspace="10" alt="New Relic RPM"/></a>
15
+ <a href='/newrelic'><img src="/newrelic/file/images/new_relic_rpm_desktop.gif" hspace="10" alt="New Relic RPM"/></a>
16
16
  </td>
17
17
  <td class="top_nav" valign="bottom">
18
18
  <ul id="navlist">
@@ -22,7 +22,7 @@
22
22
  </tr>
23
23
  </table>
24
24
  <div id="page_nav">
25
- <table width="100%" height="100%" background="<%= url_for(:controller => :newrelic, :action => :file, :file => 'gray_bar.gif') %>">
25
+ <table width="100%" height="100%" background="/newrelic/file/images/gray_bar.gif">
26
26
  <tr valign="middle">
27
27
  <td>
28
28
  <span class="application_title">Developer Mode</span>
@@ -38,7 +38,7 @@
38
38
  <%= yield %>
39
39
  </div>
40
40
  <div id='footer'>
41
- <img width="100%" height="4" src="<%= url_for(:controller => :newrelic, :action => :file, :file => 'blue_bar.gif', :content_type => 'image/gif') %>" alt="spacer"/>
41
+ <img width="100%" height="4" src="/newrelic/file/images/blue_bar.gif" alt="spacer"/>
42
42
  <p>
43
43
  <a href="/newrelic">Home</a> | <a href="&#109;&#97;&#105;&#108;&#116;&#111;:&#x73;&#x75;&#x70;&#112;&#111;&#x72;&#116;&#x40;&#x6E;&#x65;&#119;&#114;&#x65;&#x6C;&#105;&#x63;&#x2E;&#99;&#x6F;&#109;?subject=&#70;&#101;&#x65;&#x64;&#x62;&#x61;&#x63;&#107;" title="">&#x46;&#x65;&#101;&#x64;&#98;&#97;&#x63;&#x6B;</a><br />
44
44
  Monitor your Rails Application in Production. <a href="http://www.newrelic.com/dev-upgrade.html">Learn more. &raquo;</a><br />
@@ -17,11 +17,11 @@
17
17
  <tr>
18
18
  <th align=right>Plan</th>
19
19
  <td><p class="plan">
20
- <% @explanation.each do |row| -%>
21
- <% row.each do |col| -%>
20
+ <% @explanation.each do |row| %>
21
+ <% row.each do |col| %>
22
22
  <%= h(col) %>
23
- <% end -%>
24
- <% end -%>
23
+ <% end %>
24
+ <% end %>
25
25
  </p></td>
26
26
  </tr>
27
27
  <% end %>
@@ -1,19 +1,20 @@
1
+ <% sample = object %>
1
2
  <tr class="<%= cycle('even_row', 'odd_row') %>">
2
- <td align=right nowrap=true>
3
- <%= Time.at(stripped_sample(sample).timestamp).strftime "%H:%M:%S" %>
4
- </td>
5
- <td align=right nowrap=true>
6
- <%= colorize(stripped_sample(sample).duration, 1, 2) %> ms
7
- </td>
8
- <td>
9
- <%= link_to "#{sample.params[:uri]}", :action => :show_sample_summary, :id => sample.sample_id %>
10
- </td>
11
- <td>
12
- <% if sample.profile %>
13
- <%= link_to "[Profile]", :action => :show_sample_summary, :id => sample.sample_id %>
14
- <% else %>
15
- <%= link_to "[Detail]", :action => :show_sample_detail, :id => sample.sample_id %><br/>
16
- <%= link_to "[SQL (#{sample.sql_segments.size})]", :action => :show_sample_sql, :id => sample.sample_id %>
17
- <% end %>
18
- </td>
3
+ <td align=right nowrap=true>
4
+ <%= Time.at(stripped_sample(sample).timestamp).strftime "%H:%M:%S" %>
5
+ </td>
6
+ <td align=right nowrap=true>
7
+ <%= colorize(stripped_sample(sample).duration, 1, 2) %> ms
8
+ </td>
9
+ <td>
10
+ <%= link_to "#{sample.params[:uri]}", "show_sample_summary?id=#{sample.sample_id}" %>
11
+ </td>
12
+ <td>
13
+ <% if sample.profile %>
14
+ <%= link_to "[Profile]", "show_sample_summary?id=#{sample.sample_id}" %>
15
+ <% else %>
16
+ <%= link_to "[Detail]", "show_sample_detail?id=#{sample.sample_id}" %><br/>
17
+ <%= link_to "[SQL (#{sample.sql_segments.size})]", "show_sample_sql?id=#{sample.sample_id}" %>
18
+ <% end %>
19
+ </td>
19
20
  </tr>
@@ -1,3 +1,4 @@
1
+ <% segment, indent, repeat = object %>
1
2
  <tr style="<%= 'display:none' if indent > 1 %>" child_row_class="<%=segment_child_row_class(segment)%>" onmouseover="mouse_over_row(this)" onmouseout="mouse_out_row(this)" class='<%=segment_row_classes(segment, indent)%>'>
2
3
 
3
4
  <td nowrap=true>
@@ -1,14 +1,14 @@
1
1
  <tr class='<%= cycle('even_row', 'odd_row') %>'>
2
2
  <td>
3
- <%= write_summary_segment_label segment_row %>
3
+ <%= write_summary_segment_label object %>
4
4
  <small>
5
- <%= link_to "?", url_for_metric_doc(segment_row.metric_name) %>
5
+ <%= link_to "?", url_for_metric_doc(object.metric_name) %>
6
6
  </small>
7
7
  </td>
8
- <td align=left> <%= segment_row.call_count %></td>
9
- <td align=right><%= with_delimiter(to_ms(segment_row.exclusive_time)) %> ms</td>
10
- <td align=right><%= to_percentage(segment_row.exclusive_time_percentage) %>% </td>
8
+ <td align=left> <%= object.call_count %></td>
9
+ <td align=right><%= with_delimiter(to_ms(object.exclusive_time)) %> ms</td>
10
+ <td align=right><%= to_percentage(object.exclusive_time_percentage) %>% </td>
11
11
  <td> </td>
12
- <td align=right><%= with_delimiter(to_ms(segment_row.total_time)) %> ms</td>
13
- <td align=right><%= to_percentage(segment_row.total_time_percentage) %>%</td>
14
- </tr>
12
+ <td align=right><%= with_delimiter(to_ms(object.total_time)) %> ms</td>
13
+ <td align=right><%= to_percentage(object.total_time_percentage) %>%</td>
14
+ </tr>
@@ -21,4 +21,4 @@
21
21
  <%= render_sample_details(@sample) %>
22
22
  </table>
23
23
 
24
- <%= render :partial => agent_views_path('segment_limit_message') if trace_row_display_limit_reached %>
24
+ <%= render :partial => 'segment_limit_message' if trace_row_display_limit_reached %>
@@ -5,7 +5,7 @@
5
5
  visibility, you must remove <samp>rows_logger_plugin</samp>, or change your plugin load order
6
6
  so that the rows logger is loaded first.
7
7
  <% else %>
8
- <%= render :partial => agent_views_path('segment_limit_message') if trace_row_display_limit_reached %>
8
+ <%= render :partial => 'segment_limit_message' if trace_row_display_limit_reached %>
9
9
  <table width="100%">
10
10
  <thead>
11
11
  <tr>
@@ -15,6 +15,6 @@
15
15
  </tr>
16
16
  </thead>
17
17
 
18
- <%= render :partial => agent_views_path('sql_row'), :collection => @sample.sql_segments[0...trace_row_display_limit] %>
18
+ <%= render :partial => 'sql_row', :collection => @sample.sql_segments[0...trace_row_display_limit] %>
19
19
  </table>
20
20
  <% end %>
@@ -1,11 +1,16 @@
1
- <% segment = sql_row %>
1
+ <% segment = object %>
2
2
  <tr class='<%= cycle('even_row', 'odd_row') %>'>
3
3
  <td align=right><%= timestamp(segment) %></td>
4
4
  <td align=right><%= segment_duration_value(segment) %> </td>
5
5
  <td> <%= link_to_source(segment[:backtrace]) %> </td>
6
6
  <td align=left>
7
7
  <div class="sql_statement">
8
- <small><%= line_wrap_sql(segment[:sql] || segment[:sql_obfuscated]) %></small>
8
+ <small>
9
+ <% if segment[:sql] %>
10
+ <%= line_wrap_sql(segment[:sql] ) %>
11
+ <% else %>
12
+ Non-sql query: <%= segment.metric_name %> <%= line_wrap_sql(segment[:key]) %>
13
+ <% end %></small>
9
14
  </div>
10
15
  </td>
11
- </tr>
16
+ </tr>