fiveruns_tuneup 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. data/History.rdoc +3 -0
  2. data/Manifest +57 -0
  3. data/README.rdoc +44 -0
  4. data/Rakefile +15 -0
  5. data/assets/images/arrows.gif +0 -0
  6. data/assets/images/edit.png +0 -0
  7. data/assets/images/fade.png +0 -0
  8. data/assets/images/fade_down.png +0 -0
  9. data/assets/images/head.gif +0 -0
  10. data/assets/images/logo.gif +0 -0
  11. data/assets/images/logo_clear.png +0 -0
  12. data/assets/images/magnify.png +0 -0
  13. data/assets/images/pip.gif +0 -0
  14. data/assets/images/pointer.gif +0 -0
  15. data/assets/images/schema.png +0 -0
  16. data/assets/images/signin.gif +0 -0
  17. data/assets/images/spinner.gif +0 -0
  18. data/assets/images/warning.gif +0 -0
  19. data/assets/javascripts/prototype.js +2515 -0
  20. data/assets/javascripts/tuneup.js +30 -0
  21. data/assets/stylesheets/tuneup.css +204 -0
  22. data/bin/fiveruns_tuneup +26 -0
  23. data/fiveruns_tuneup.gemspec +49 -0
  24. data/init.rb +2 -0
  25. data/install.rb +18 -0
  26. data/lib/bumpspark_helper.rb +52 -0
  27. data/lib/fiveruns/tuneup.rb +103 -0
  28. data/lib/fiveruns/tuneup/asset_tags.rb +39 -0
  29. data/lib/fiveruns/tuneup/custom_methods.rb +8 -0
  30. data/lib/fiveruns/tuneup/environment.rb +29 -0
  31. data/lib/fiveruns/tuneup/instrumentation/action_controller/base.rb +59 -0
  32. data/lib/fiveruns/tuneup/instrumentation/action_view/base.rb +77 -0
  33. data/lib/fiveruns/tuneup/instrumentation/active_record/base.rb +126 -0
  34. data/lib/fiveruns/tuneup/instrumentation/cgi/session.rb +30 -0
  35. data/lib/fiveruns/tuneup/instrumentation/utilities.rb +172 -0
  36. data/lib/fiveruns/tuneup/multipart.rb +75 -0
  37. data/lib/fiveruns/tuneup/runs.rb +86 -0
  38. data/lib/fiveruns/tuneup/schema.rb +43 -0
  39. data/lib/fiveruns/tuneup/step.rb +219 -0
  40. data/lib/fiveruns/tuneup/urls.rb +23 -0
  41. data/lib/fiveruns/tuneup/version.rb +80 -0
  42. data/lib/fiveruns_tuneup.rb +1 -0
  43. data/lib/tuneup_config.rb +29 -0
  44. data/lib/tuneup_controller.rb +140 -0
  45. data/lib/tuneup_helper.rb +185 -0
  46. data/rails/init.rb +20 -0
  47. data/tasks/assets.rake +32 -0
  48. data/test/test_helper.rb +3 -0
  49. data/test/tuneup_test.rb +0 -0
  50. data/uninstall.rb +6 -0
  51. data/views/tuneup/_data.html.erb +15 -0
  52. data/views/tuneup/_flash.html.erb +6 -0
  53. data/views/tuneup/_link.html.erb +1 -0
  54. data/views/tuneup/_schema.html.erb +17 -0
  55. data/views/tuneup/_sql.html.erb +23 -0
  56. data/views/tuneup/_step.html.erb +15 -0
  57. data/views/tuneup/panel/_registered.html.erb +4 -0
  58. data/views/tuneup/panel/_unregistered.html.erb +14 -0
  59. metadata +146 -0
data/tasks/assets.rake ADDED
@@ -0,0 +1,32 @@
1
+ namespace :fiveruns do
2
+
3
+ namespace :tuneup do
4
+
5
+ namespace :tmp do
6
+
7
+ desc "Clear tempory data (runs, etc)"
8
+ task :clear => :environment do
9
+ rm_rf File.join(RAILS_ROOT, 'tmp', 'tuneup')
10
+ end
11
+
12
+ end
13
+
14
+ namespace :assets do
15
+
16
+ desc "Install assets"
17
+ task :install => :environment do
18
+ require File.dirname(__FILE__) << "/../install"
19
+ end
20
+
21
+ desc "Uninstall assets"
22
+ task :uninstall => :environment do
23
+ require File.dirname(__FILE__) << "/../uninstall"
24
+ end
25
+
26
+ task :reset => [:uninstall, :install]
27
+
28
+ end
29
+
30
+ end
31
+
32
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'Shoulda'
File without changes
data/uninstall.rb ADDED
@@ -0,0 +1,6 @@
1
+ # Remove Assets
2
+ Dir[File.join(RAILS_ROOT, 'public', '*', 'tuneup')].each do |asset_dir|
3
+ show_name = asset_dir.split(File::SEPARATOR)[-3, 3].join(File::SEPARATOR)
4
+ FileUtils.rm_rf(asset_dir) rescue nil
5
+ STDERR.puts "FiveRuns TuneUp: Removed #{show_name}"
6
+ end
@@ -0,0 +1,15 @@
1
+ <div id='tuneup-data'>
2
+ <div id='tuneup-top'>
3
+ <div id='tuneup-summary'>
4
+ <%= tuneup_bar(tuneup_data.children.first, :id => 'tuneup-root-bar') %>
5
+ <%= trend %> <%= tuneup_data.time.to_i %> ms
6
+ </div>
7
+ <%= link_to_upload %>
8
+ </div>
9
+ <%= render :partial => 'schema' %>
10
+ <div id='tuneup-details'>
11
+ <ul>
12
+ <%= render :partial => 'step', :collection => tuneup_data.children %>
13
+ </ul>
14
+ </div>
15
+ </div>
@@ -0,0 +1,6 @@
1
+ <p>
2
+ <%= message %>
3
+ <% if type == :error %>
4
+ <emph>If problems persist, please contact <%= link_to "FiveRuns Support", 'mailto:support@fiveruns.com' %>.</emph>
5
+ <% end %>
6
+ </p>
@@ -0,0 +1 @@
1
+ <p class='full'><%= tuneup_collection_link %></p>
@@ -0,0 +1,17 @@
1
+ <div id='tuneup-schema' style='display:none;'>
2
+ <% Fiveruns::Tuneup.schemas.each do |table, schema| %>
3
+ <div id='tuneup-schema-table-<%= table %>' class='tuneup-schema-table' style='display:none;'>
4
+ <h3>Schema for &ldquo;<%= table %>&rdquo;</h3>
5
+ <table>
6
+ <tr>
7
+ <th>Name</th><th>Type</th>
8
+ </tr>
9
+ <% schema[:columns].each do |column| %>
10
+ <tr>
11
+ <td><%=h column[:name] %></td><td><%=h column[:sql_type] %></td>
12
+ </tr>
13
+ <% end %>
14
+ </table>
15
+ </div>
16
+ <% end %>
17
+ </div>
@@ -0,0 +1,23 @@
1
+ <form id='<%= dom_id(step, :sql) %>' style='display:none;'>
2
+ <textarea cols='80' rows='<%= sql.query.split("\n").size %>'><%= sql.query %></textarea>
3
+ <% if sql.explain %>
4
+ <table>
5
+ <tr>
6
+ <% sql.explain.fields.each do |field| %>
7
+ <th><%=h field %></th>
8
+ <% end %>
9
+ </tr>
10
+ <% sql.explain.rows.each do |row| %>
11
+ <tr>
12
+ <% row.each_with_index do |value, index| %>
13
+ <% if index == sql.explain.table_offset %>
14
+ <td><%= link_to_schema value, value %></td>
15
+ <% else %>
16
+ <td><%=h value%></td>
17
+ <% end %>
18
+ <% end %>
19
+ </tr>
20
+ <% end %>
21
+ </table>
22
+ <% end %>
23
+ </form>
@@ -0,0 +1,15 @@
1
+ <% content_tag_for :li, step, :class => tuneup_css_class_for_step(step) do %>
2
+ <dl class='tuneup-step-info'>
3
+ <dt><p><span class='time'><%= '%.2f' % step.time %> ms</span>
4
+ <%= tuneup_step_link(step) %>
5
+ <%= link_to_edit_step(step) %>
6
+ </p></dt>
7
+ <dd><%= tuneup_bar(step, :width => (280 * (step.time / tuneup_data.time))) %></dd>
8
+ </dl>
9
+ <%= render :partial => 'sql', :object => step.sql, :locals => {:step => step} if step.sql %>
10
+ <% if step.children.any? %>
11
+ <ul id='<%= dom_id step, :children %>'<% if step.depth > 1 %> class='fiveruns_tuneup_children' <% unless open_step?(step) %>style='display:none'<% end %><% end %>>
12
+ <%= render :partial => 'step', :collection => step.children_with_disparity %>
13
+ </ul>
14
+ <% end %>
15
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <div id='tuneup-panel'>
2
+ <%= render(:partial => 'data') if !tuneup_data.blank? && tuneup_collecting? %>
3
+ <%= render :partial => 'link' %>
4
+ </div>
@@ -0,0 +1,14 @@
1
+ <% form_remote_tag :url => '/tuneup/signin', :loading => 'TuneUp.Spinner.start()', :complete => 'TuneUp.Spinner.stop()' do %>
2
+ <p class='full'>
3
+ <label for='email'>Email</label>
4
+ <%= text_field_tag :email, nil, :size => 20 %>
5
+
6
+ <label for='password'>Password</label>
7
+ <%= password_field_tag %>
8
+
9
+ <button><%= image_tag '/images/tuneup/signin.gif', :alt => 'Sign In' %></button>
10
+ or
11
+ <%= link_to "Sign Up for an Account", tuneup_signup_url %>
12
+ </p>
13
+
14
+ <% end %>
metadata ADDED
@@ -0,0 +1,146 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fiveruns_tuneup
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.2
5
+ platform: ruby
6
+ authors:
7
+ - FiveRuns Development Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-05-30 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ description: Instrumentation for the FiveRuns TuneUp product.
25
+ email: dev@fiveruns.com
26
+ executables:
27
+ - fiveruns_tuneup
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - bin/fiveruns_tuneup
32
+ - lib/bumpspark_helper.rb
33
+ - lib/fiveruns/tuneup/asset_tags.rb
34
+ - lib/fiveruns/tuneup/custom_methods.rb
35
+ - lib/fiveruns/tuneup/environment.rb
36
+ - lib/fiveruns/tuneup/instrumentation/action_controller/base.rb
37
+ - lib/fiveruns/tuneup/instrumentation/action_view/base.rb
38
+ - lib/fiveruns/tuneup/instrumentation/active_record/base.rb
39
+ - lib/fiveruns/tuneup/instrumentation/cgi/session.rb
40
+ - lib/fiveruns/tuneup/instrumentation/utilities.rb
41
+ - lib/fiveruns/tuneup/multipart.rb
42
+ - lib/fiveruns/tuneup/runs.rb
43
+ - lib/fiveruns/tuneup/schema.rb
44
+ - lib/fiveruns/tuneup/step.rb
45
+ - lib/fiveruns/tuneup/urls.rb
46
+ - lib/fiveruns/tuneup/version.rb
47
+ - lib/fiveruns/tuneup.rb
48
+ - lib/fiveruns_tuneup.rb
49
+ - lib/tuneup_config.rb
50
+ - lib/tuneup_controller.rb
51
+ - lib/tuneup_helper.rb
52
+ - README.rdoc
53
+ - tasks/assets.rake
54
+ files:
55
+ - assets/images/arrows.gif
56
+ - assets/images/edit.png
57
+ - assets/images/fade.png
58
+ - assets/images/fade_down.png
59
+ - assets/images/head.gif
60
+ - assets/images/logo.gif
61
+ - assets/images/logo_clear.png
62
+ - assets/images/magnify.png
63
+ - assets/images/pip.gif
64
+ - assets/images/pointer.gif
65
+ - assets/images/schema.png
66
+ - assets/images/signin.gif
67
+ - assets/images/spinner.gif
68
+ - assets/images/warning.gif
69
+ - assets/javascripts/prototype.js
70
+ - assets/javascripts/tuneup.js
71
+ - assets/stylesheets/tuneup.css
72
+ - bin/fiveruns_tuneup
73
+ - History.rdoc
74
+ - init.rb
75
+ - install.rb
76
+ - lib/bumpspark_helper.rb
77
+ - lib/fiveruns/tuneup/asset_tags.rb
78
+ - lib/fiveruns/tuneup/custom_methods.rb
79
+ - lib/fiveruns/tuneup/environment.rb
80
+ - lib/fiveruns/tuneup/instrumentation/action_controller/base.rb
81
+ - lib/fiveruns/tuneup/instrumentation/action_view/base.rb
82
+ - lib/fiveruns/tuneup/instrumentation/active_record/base.rb
83
+ - lib/fiveruns/tuneup/instrumentation/cgi/session.rb
84
+ - lib/fiveruns/tuneup/instrumentation/utilities.rb
85
+ - lib/fiveruns/tuneup/multipart.rb
86
+ - lib/fiveruns/tuneup/runs.rb
87
+ - lib/fiveruns/tuneup/schema.rb
88
+ - lib/fiveruns/tuneup/step.rb
89
+ - lib/fiveruns/tuneup/urls.rb
90
+ - lib/fiveruns/tuneup/version.rb
91
+ - lib/fiveruns/tuneup.rb
92
+ - lib/fiveruns_tuneup.rb
93
+ - lib/tuneup_config.rb
94
+ - lib/tuneup_controller.rb
95
+ - lib/tuneup_helper.rb
96
+ - Manifest
97
+ - rails/init.rb
98
+ - Rakefile
99
+ - README.rdoc
100
+ - tasks/assets.rake
101
+ - test/test_helper.rb
102
+ - test/tuneup_test.rb
103
+ - uninstall.rb
104
+ - views/tuneup/_data.html.erb
105
+ - views/tuneup/_flash.html.erb
106
+ - views/tuneup/_link.html.erb
107
+ - views/tuneup/_schema.html.erb
108
+ - views/tuneup/_sql.html.erb
109
+ - views/tuneup/_step.html.erb
110
+ - views/tuneup/panel/_registered.html.erb
111
+ - views/tuneup/panel/_unregistered.html.erb
112
+ - fiveruns_tuneup.gemspec
113
+ has_rdoc: true
114
+ homepage: http://github.com/fiveruns/fiveruns_tuneup
115
+ post_install_message:
116
+ rdoc_options:
117
+ - --line-numbers
118
+ - --inline-source
119
+ - --title
120
+ - Fiveruns_tuneup
121
+ - --main
122
+ - README.rdoc
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: "0"
130
+ version:
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: "0"
136
+ version:
137
+ requirements: []
138
+
139
+ rubyforge_project: fiveruns
140
+ rubygems_version: 1.1.1
141
+ signing_key:
142
+ specification_version: 2
143
+ summary: Instrumentation for the FiveRuns TuneUp product.
144
+ test_files:
145
+ - test/test_helper.rb
146
+ - test/tuneup_test.rb