stackprofiler 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +81 -0
  6. data/Rakefile +2 -0
  7. data/lib/stackprofiler.rb +21 -0
  8. data/lib/stackprofiler/data_collector.rb +24 -0
  9. data/lib/stackprofiler/filters/compress_tree.rb +25 -0
  10. data/lib/stackprofiler/filters/js_tree.rb +24 -0
  11. data/lib/stackprofiler/filters/stackprofiler_elision.rb +12 -0
  12. data/lib/stackprofiler/middleware.rb +18 -0
  13. data/lib/stackprofiler/run_data_source.rb +43 -0
  14. data/lib/stackprofiler/version.rb +3 -0
  15. data/lib/stackprofiler/web_ui.rb +111 -0
  16. data/lib/stackprofiler/web_ui/public/css/bootstrap-theme.css +442 -0
  17. data/lib/stackprofiler/web_ui/public/css/bootstrap-theme.css.map +1 -0
  18. data/lib/stackprofiler/web_ui/public/css/bootstrap-theme.min.css +5 -0
  19. data/lib/stackprofiler/web_ui/public/css/bootstrap.css +6203 -0
  20. data/lib/stackprofiler/web_ui/public/css/bootstrap.css.map +1 -0
  21. data/lib/stackprofiler/web_ui/public/css/bootstrap.min.css +5 -0
  22. data/lib/stackprofiler/web_ui/public/css/coderay.css +131 -0
  23. data/lib/stackprofiler/web_ui/public/css/jquery-ui.css +1225 -0
  24. data/lib/stackprofiler/web_ui/public/css/splitter.css +57 -0
  25. data/lib/stackprofiler/web_ui/public/fonts/glyphicons-halflings-regular.eot +0 -0
  26. data/lib/stackprofiler/web_ui/public/fonts/glyphicons-halflings-regular.svg +229 -0
  27. data/lib/stackprofiler/web_ui/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  28. data/lib/stackprofiler/web_ui/public/fonts/glyphicons-halflings-regular.woff +0 -0
  29. data/lib/stackprofiler/web_ui/public/js/bootstrap.js +2114 -0
  30. data/lib/stackprofiler/web_ui/public/js/bootstrap.min.js +6 -0
  31. data/lib/stackprofiler/web_ui/public/js/jquery.min.js +4 -0
  32. data/lib/stackprofiler/web_ui/public/js/splitter.js +293 -0
  33. data/lib/stackprofiler/web_ui/public/jstree/jstree.js +7073 -0
  34. data/lib/stackprofiler/web_ui/public/jstree/jstree.min.js +5 -0
  35. data/lib/stackprofiler/web_ui/public/jstree/themes/default-dark/32px.png +0 -0
  36. data/lib/stackprofiler/web_ui/public/jstree/themes/default-dark/40px.png +0 -0
  37. data/lib/stackprofiler/web_ui/public/jstree/themes/default-dark/style.css +1094 -0
  38. data/lib/stackprofiler/web_ui/public/jstree/themes/default-dark/style.min.css +1 -0
  39. data/lib/stackprofiler/web_ui/public/jstree/themes/default-dark/throbber.gif +0 -0
  40. data/lib/stackprofiler/web_ui/public/jstree/themes/default/32px.png +0 -0
  41. data/lib/stackprofiler/web_ui/public/jstree/themes/default/40px.png +0 -0
  42. data/lib/stackprofiler/web_ui/public/jstree/themes/default/style.css +1050 -0
  43. data/lib/stackprofiler/web_ui/public/jstree/themes/default/style.min.css +1 -0
  44. data/lib/stackprofiler/web_ui/public/jstree/themes/default/throbber.gif +0 -0
  45. data/lib/stackprofiler/web_ui/public/octicons/LICENSE.txt +9 -0
  46. data/lib/stackprofiler/web_ui/public/octicons/README.md +1 -0
  47. data/lib/stackprofiler/web_ui/public/octicons/octicons-local.ttf +0 -0
  48. data/lib/stackprofiler/web_ui/public/octicons/octicons.css +235 -0
  49. data/lib/stackprofiler/web_ui/public/octicons/octicons.eot +0 -0
  50. data/lib/stackprofiler/web_ui/public/octicons/octicons.less +233 -0
  51. data/lib/stackprofiler/web_ui/public/octicons/octicons.svg +198 -0
  52. data/lib/stackprofiler/web_ui/public/octicons/octicons.ttf +0 -0
  53. data/lib/stackprofiler/web_ui/public/octicons/octicons.woff +0 -0
  54. data/lib/stackprofiler/web_ui/public/octicons/sprockets-octicons.scss +230 -0
  55. data/lib/stackprofiler/web_ui/views/code.erb +18 -0
  56. data/lib/stackprofiler/web_ui/views/index.erb +45 -0
  57. data/lib/stackprofiler/web_ui/views/layout.erb +79 -0
  58. data/stackprofiler.gemspec +30 -0
  59. metadata +213 -0
@@ -0,0 +1,45 @@
1
+ <% content_for :navbar_left do %>
2
+ <li class="dropdown">
3
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">Profiles <b class="caret"></b></a>
4
+ <ul class="dropdown-menu">
5
+ <% @runs.each_with_index do |run, run_id| %>
6
+ <li><a href="/__stackprofiler/?run_id=<%= run_id %>"><%= run.url %></a>&nbsp;(<b><%= run.duration %>s</b>)</li>
7
+ <% end %>
8
+ </ul>
9
+ </li>
10
+ <% end %>
11
+
12
+ <div id="foo" style="">
13
+ <div id="a">
14
+ <div id="jstree_demo"></div>
15
+ </div>
16
+ <div id="b">
17
+ <div id="source-display"></div>
18
+ </div>
19
+ </div>
20
+
21
+ <script>
22
+ $(function() {
23
+ $('#foo').split({
24
+ orientation: 'horizontal',
25
+ limit: 10,
26
+ position: '40%'
27
+ });
28
+
29
+ var $tree = $('#jstree_demo');
30
+
31
+ $tree.jstree({
32
+ core: {
33
+ data: {
34
+ url: '/__stackprofiler/json?run_id=<%= @run_id %>'
35
+ }
36
+ }
37
+ });
38
+
39
+ $tree.on("changed.jstree", function (e, data) {
40
+ var addrs = data.node.data.addrs;
41
+ var url = "/__stackprofiler/code/" + addrs[0] + "?run_id=<%= @run_id %>";
42
+ $("#source-display").load(url);
43
+ });
44
+ });
45
+ </script>
@@ -0,0 +1,79 @@
1
+ <html>
2
+ <head>
3
+ <link rel="stylesheet" href="/__stackprofiler/css/bootstrap.min.css" />
4
+ <link rel="stylesheet" href="/__stackprofiler/css/splitter.css" />
5
+ <link rel="stylesheet" href="/__stackprofiler/jstree/themes/default/style.min.css" />
6
+ <link rel="stylesheet" href="/__stackprofiler/css/coderay.css" />
7
+ <link rel="stylesheet" href="/__stackprofiler/octicons/octicons.css" />
8
+ <script src="/__stackprofiler/js/jquery.min.js"></script>
9
+ <script src="/__stackprofiler/js/bootstrap.min.js"></script>
10
+ <script src="/__stackprofiler/jstree/jstree.js"></script>
11
+ <script src="/__stackprofiler/js/splitter.js"></script>
12
+ <style>
13
+ body, html {
14
+ height: 100%;
15
+ }
16
+
17
+ .fill {
18
+ top: 67px;
19
+ left: 0;
20
+ right: 0;
21
+ bottom: 0;
22
+ position: absolute;
23
+ width: auto;
24
+ height: auto;
25
+ }
26
+
27
+ #github-link {
28
+ margin-top: -6px;
29
+ margin-bottom: -6px;
30
+ }
31
+
32
+ #foo {
33
+ height: 100%;
34
+ }
35
+
36
+ .jstree-default a {
37
+ white-space:normal !important; height: auto;
38
+ }
39
+ .jstree-anchor {
40
+ height: auto !important;
41
+ }
42
+ .jstree-default li > ins {
43
+ vertical-align:top;
44
+ }
45
+ .jstree-leaf {
46
+ height: auto;
47
+ }
48
+ .jstree-leaf a{
49
+ height: auto !important;
50
+ }
51
+ </style>
52
+ </head>
53
+ <body>
54
+ <div class="navbar navbar-default">
55
+ <div class="navbar-header">
56
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
57
+ </button>
58
+ <a class="navbar-brand" href="#">Stackprofiler</a>
59
+ </div>
60
+ <div class="navbar-collapse collapse navbar-responsive-collapse">
61
+ <ul class="nav navbar-nav">
62
+ <%= yield_content :navbar_left %>
63
+ </ul>
64
+ <ul class="nav navbar-nav navbar-right">
65
+ <%= yield_content :navbar_right %>
66
+ <li><a id="github-link" href="https://github.com/glassechidna/stackprofiler"><span class="mega-octicon octicon-mark-github"></span></a></li>
67
+ </ul>
68
+ </div>
69
+ </div>
70
+
71
+ <div class="container fill">
72
+ <div class="row">
73
+ <div class="col-md-12">
74
+ <%= yield %>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </body>
79
+ </html>
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'stackprofiler/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'stackprofiler'
8
+ spec.version = Stackprofiler::VERSION
9
+ spec.authors = ['Aidan Steele']
10
+ spec.email = ['aidan.steele@glassechidna.com.au']
11
+ spec.summary = %q{Web UI wrapper for the awesome stackprof profiler.}
12
+ # spec.description = %q{TODO: Write a longer description. Optional.}
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.7'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+
24
+ spec.add_dependency 'stackprof'
25
+ spec.add_dependency 'rubytree'
26
+ spec.add_dependency 'sinatra'
27
+ spec.add_dependency 'sinatra-contrib'
28
+ spec.add_dependency 'coderay'
29
+ spec.add_dependency 'oj'
30
+ end
metadata ADDED
@@ -0,0 +1,213 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stackprofiler
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Aidan Steele
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: stackprof
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubytree
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sinatra
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sinatra-contrib
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coderay
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: oj
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description:
126
+ email:
127
+ - aidan.steele@glassechidna.com.au
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".gitignore"
133
+ - Gemfile
134
+ - LICENSE.txt
135
+ - README.md
136
+ - Rakefile
137
+ - lib/stackprofiler.rb
138
+ - lib/stackprofiler/data_collector.rb
139
+ - lib/stackprofiler/filters/compress_tree.rb
140
+ - lib/stackprofiler/filters/js_tree.rb
141
+ - lib/stackprofiler/filters/stackprofiler_elision.rb
142
+ - lib/stackprofiler/middleware.rb
143
+ - lib/stackprofiler/run_data_source.rb
144
+ - lib/stackprofiler/version.rb
145
+ - lib/stackprofiler/web_ui.rb
146
+ - lib/stackprofiler/web_ui/public/css/bootstrap-theme.css
147
+ - lib/stackprofiler/web_ui/public/css/bootstrap-theme.css.map
148
+ - lib/stackprofiler/web_ui/public/css/bootstrap-theme.min.css
149
+ - lib/stackprofiler/web_ui/public/css/bootstrap.css
150
+ - lib/stackprofiler/web_ui/public/css/bootstrap.css.map
151
+ - lib/stackprofiler/web_ui/public/css/bootstrap.min.css
152
+ - lib/stackprofiler/web_ui/public/css/coderay.css
153
+ - lib/stackprofiler/web_ui/public/css/jquery-ui.css
154
+ - lib/stackprofiler/web_ui/public/css/splitter.css
155
+ - lib/stackprofiler/web_ui/public/fonts/glyphicons-halflings-regular.eot
156
+ - lib/stackprofiler/web_ui/public/fonts/glyphicons-halflings-regular.svg
157
+ - lib/stackprofiler/web_ui/public/fonts/glyphicons-halflings-regular.ttf
158
+ - lib/stackprofiler/web_ui/public/fonts/glyphicons-halflings-regular.woff
159
+ - lib/stackprofiler/web_ui/public/js/bootstrap.js
160
+ - lib/stackprofiler/web_ui/public/js/bootstrap.min.js
161
+ - lib/stackprofiler/web_ui/public/js/jquery.min.js
162
+ - lib/stackprofiler/web_ui/public/js/splitter.js
163
+ - lib/stackprofiler/web_ui/public/jstree/jstree.js
164
+ - lib/stackprofiler/web_ui/public/jstree/jstree.min.js
165
+ - lib/stackprofiler/web_ui/public/jstree/themes/default-dark/32px.png
166
+ - lib/stackprofiler/web_ui/public/jstree/themes/default-dark/40px.png
167
+ - lib/stackprofiler/web_ui/public/jstree/themes/default-dark/style.css
168
+ - lib/stackprofiler/web_ui/public/jstree/themes/default-dark/style.min.css
169
+ - lib/stackprofiler/web_ui/public/jstree/themes/default-dark/throbber.gif
170
+ - lib/stackprofiler/web_ui/public/jstree/themes/default/32px.png
171
+ - lib/stackprofiler/web_ui/public/jstree/themes/default/40px.png
172
+ - lib/stackprofiler/web_ui/public/jstree/themes/default/style.css
173
+ - lib/stackprofiler/web_ui/public/jstree/themes/default/style.min.css
174
+ - lib/stackprofiler/web_ui/public/jstree/themes/default/throbber.gif
175
+ - lib/stackprofiler/web_ui/public/octicons/LICENSE.txt
176
+ - lib/stackprofiler/web_ui/public/octicons/README.md
177
+ - lib/stackprofiler/web_ui/public/octicons/octicons-local.ttf
178
+ - lib/stackprofiler/web_ui/public/octicons/octicons.css
179
+ - lib/stackprofiler/web_ui/public/octicons/octicons.eot
180
+ - lib/stackprofiler/web_ui/public/octicons/octicons.less
181
+ - lib/stackprofiler/web_ui/public/octicons/octicons.svg
182
+ - lib/stackprofiler/web_ui/public/octicons/octicons.ttf
183
+ - lib/stackprofiler/web_ui/public/octicons/octicons.woff
184
+ - lib/stackprofiler/web_ui/public/octicons/sprockets-octicons.scss
185
+ - lib/stackprofiler/web_ui/views/code.erb
186
+ - lib/stackprofiler/web_ui/views/index.erb
187
+ - lib/stackprofiler/web_ui/views/layout.erb
188
+ - stackprofiler.gemspec
189
+ homepage: ''
190
+ licenses:
191
+ - MIT
192
+ metadata: {}
193
+ post_install_message:
194
+ rdoc_options: []
195
+ require_paths:
196
+ - lib
197
+ required_ruby_version: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ required_rubygems_version: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ requirements: []
208
+ rubyforge_project:
209
+ rubygems_version: 2.2.2
210
+ signing_key:
211
+ specification_version: 4
212
+ summary: Web UI wrapper for the awesome stackprof profiler.
213
+ test_files: []