miniprofiler 0.1.7.2 → 0.1.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/html/list.css ADDED
@@ -0,0 +1,9 @@
1
+ tbody tr:nth-child(odd) { background-color:#eee; }
2
+ tbody tr:nth-child(even) { background-color:#fff; }
3
+ table { border: 0; border-spacing:0;}
4
+ tr {border: 0;}
5
+ .date {font-size: 11px; color: #666;}
6
+ td {padding: 8px;}
7
+ .time {text-align:center;}
8
+ thead tr {background-color: #bbb; color: #444; font-size: 12px;}
9
+ thead tr th { padding: 5px 15px;}
data/lib/html/list.js ADDED
@@ -0,0 +1,37 @@
1
+ var MiniProfiler = MiniProfiler || {};
2
+ MiniProfiler.list = {
3
+ init:
4
+ function (options) {
5
+ var opt = options || {};
6
+
7
+ var updateGrid = function (id) {
8
+ jQueryMP.ajax({
9
+ url: options.path + 'results-list',
10
+ data: { "last-id": id },
11
+ dataType: 'json',
12
+ type: 'GET',
13
+ success: function (data) {
14
+ jQueryMP('table tbody').append(jQueryMP("#rowTemplate").tmpl(data));
15
+ var oldId = id;
16
+ var oldData = data;
17
+ setTimeout(function () {
18
+ var newId = oldId;
19
+ if (oldData.length > 0) {
20
+ newId = oldData[oldData.length - 1].Id;
21
+ }
22
+ updateGrid(newId);
23
+ }, 4000);
24
+ }
25
+ });
26
+ }
27
+
28
+ MiniProfiler.path = options.path;
29
+ jQueryMP.get(options.path + 'list.tmpl?v=' + options.version, function (data) {
30
+ if (data) {
31
+ jQueryMP('body').append(data);
32
+ jQueryMP('body').append(jQueryMP('#tableTemplate').tmpl());
33
+ updateGrid();
34
+ }
35
+ });
36
+ }
37
+ };
@@ -0,0 +1,34 @@
1
+ <script id="tableTemplate" type="text/x-jquery-tmpl">
2
+ <table>
3
+ <thead>
4
+ <tr>
5
+ <th>Name</th>
6
+ <th>Started</th>
7
+ <th>Sql Duration</th>
8
+ <th>Total Duration</th>
9
+ <th>Request Start</th>
10
+ <th>Response Start</th>
11
+ <th>Dom Complete</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+
16
+ </tbody>
17
+ </table>
18
+ </script>
19
+ <script id="rowTemplate" type="text/x-jquery-tmpl">
20
+ <tr>
21
+ <td>
22
+ <a href="${MiniProfiler.path}results?id=${Id}">${Name}</a></td>
23
+ <td class="date">${MiniProfiler.renderDate(Started)}</td>
24
+ <td class="time">${DurationMillisecondsInSql}</td>
25
+ <td class="time">${DurationMilliseconds}</td>
26
+ {{if ClientTimings}}
27
+ <td class="time">${MiniProfiler.getClientTimingByName(ClientTimings,"Request").Start}</td>
28
+ <td class="time">${MiniProfiler.getClientTimingByName(ClientTimings,"Response").Start}</td>
29
+ <td class="time">${MiniProfiler.getClientTimingByName(ClientTimings,"Dom Complete").Start}</td>
30
+ {{else}}
31
+ <td colspan="3"></td>
32
+ {{/if}}
33
+ </tr>
34
+ </script>
@@ -0,0 +1,62 @@
1
+ <script type="text/javascript">
2
+ (function(){{
3
+ var init = function() {{
4
+ var load = function(s,f){{
5
+ var sc = document.createElement('script');
6
+ sc.async = 'async';
7
+ sc.type = 'text/javascript';
8
+ sc.src = s;
9
+ var l = false;
10
+ sc.onload = sc.onreadystatechange = function(_, abort) {{
11
+ if (!l && (!sc.readyState || /loaded|complete/.test(sc.readyState))) {{
12
+ if (!abort){{l=true; f();}}
13
+ }}
14
+ }};
15
+
16
+ document.getElementsByTagName('head')[0].appendChild(sc);
17
+ }};
18
+
19
+ var initMp = function(){{
20
+ load('{path}includes.js?v={version}',function(){{
21
+ MiniProfiler.init({{
22
+ ids: {ids},
23
+ path: '{path}',
24
+ version: '{version}',
25
+ renderPosition: '{position}',
26
+ showTrivial: {showTrivial},
27
+ showChildrenTime: {showChildren},
28
+ maxTracesToShow: {maxTracesToShow},
29
+ showControls: {showControls},
30
+ currentId: '{currentId}',
31
+ authorized: {authorized}
32
+ }});
33
+ }});
34
+ }};
35
+ if ({useExistingjQuery}) {{
36
+ jQueryMP = jQuery;
37
+ initMp();
38
+ }} else {{
39
+ load('{path}jquery.1.7.1.js?v={version}', initMp);
40
+ }}
41
+
42
+ }};
43
+
44
+ var w = 0;
45
+ var f = false;
46
+ var deferInit = function(){{
47
+ if (f) return;
48
+ if (window.performance && window.performance.timing && window.performance.timing.loadEventEnd == 0 && w < 10000){{
49
+ setTimeout(deferInit, 100);
50
+ w += 100;
51
+ }} else {{
52
+ f = true;
53
+ init();
54
+ }}
55
+ }};
56
+ if (document.addEventListener) {{
57
+ document.addEventListener('DOMContentLoaded',deferInit);
58
+ }}
59
+ var o = window.onload;
60
+ window.onload = function(){{if(o)o; deferInit()}};
61
+ }})();
62
+ </script>
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "miniprofiler"
3
- s.version = "0.1.7.2"
3
+ s.version = "0.1.7.3"
4
4
  s.summary = "Profiles loading speed for rack applications."
5
5
  s.authors = ["Aleks Totic","Sam Saffron", "Robin Ward"]
6
6
  s.description = "Page loading speed displayed on every page. Optimize while you develop, performance is a feature."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miniprofiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7.2
4
+ version: 0.1.7.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ date: 2012-07-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rack
18
- requirement: &2152697720 !ruby/object:Gem::Requirement
18
+ requirement: &2165244220 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 1.1.3
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *2152697720
26
+ version_requirements: *2165244220
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
- requirement: &2152695680 !ruby/object:Gem::Requirement
29
+ requirement: &2165198480 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
- version_requirements: *2152695680
37
+ version_requirements: *2165198480
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: rack-test
40
- requirement: &2152694600 !ruby/object:Gem::Requirement
40
+ requirement: &2165197760 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :development
47
47
  prerelease: false
48
- version_requirements: *2152694600
48
+ version_requirements: *2165197760
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: activerecord
51
- requirement: &2152693820 !ruby/object:Gem::Requirement
51
+ requirement: &2165196320 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ~>
@@ -56,7 +56,7 @@ dependencies:
56
56
  version: '3.0'
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *2152693820
59
+ version_requirements: *2165196320
60
60
  description: Page loading speed displayed on every page. Optimize while you develop,
61
61
  performance is a feature.
62
62
  email: sam.saffron@gmail.com
@@ -85,6 +85,16 @@ files:
85
85
  - UI/list.tmpl
86
86
  - UI/share.html
87
87
  - autotest/discover.rb
88
+ - lib/html/includes.css
89
+ - lib/html/includes.js
90
+ - lib/html/includes.less
91
+ - lib/html/includes.tmpl
92
+ - lib/html/jquery.1.7.1.js
93
+ - lib/html/jquery.tmpl.js
94
+ - lib/html/list.css
95
+ - lib/html/list.js
96
+ - lib/html/list.tmpl
97
+ - lib/html/profile_handler.js
88
98
  - lib/mini_profiler/body_add_proxy.rb
89
99
  - lib/mini_profiler/client_timer_struct.rb
90
100
  - lib/mini_profiler/config.rb
@@ -133,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
143
  version: '0'
134
144
  segments:
135
145
  - 0
136
- hash: -2940686178254341176
146
+ hash: -327493845862481263
137
147
  required_rubygems_version: !ruby/object:Gem::Requirement
138
148
  none: false
139
149
  requirements:
@@ -142,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
152
  version: '0'
143
153
  segments:
144
154
  - 0
145
- hash: -2940686178254341176
155
+ hash: -327493845862481263
146
156
  requirements: []
147
157
  rubyforge_project:
148
158
  rubygems_version: 1.8.17