rack-mini-profiler 0.10.6 → 2.3.0

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 (74) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +129 -16
  3. data/README.md +116 -63
  4. data/lib/enable_rails_patches.rb +5 -0
  5. data/lib/generators/rack_profiler/install_generator.rb +2 -0
  6. data/lib/generators/rack_profiler/templates/rack_profiler.rb +2 -0
  7. data/lib/html/dot.1.1.2.min.js +2 -0
  8. data/lib/html/includes.css +141 -40
  9. data/lib/html/includes.js +1398 -970
  10. data/lib/html/includes.scss +547 -442
  11. data/lib/html/includes.tmpl +227 -142
  12. data/lib/html/pretty-print.js +810 -0
  13. data/lib/html/profile_handler.js +1 -1
  14. data/lib/html/rack-mini-profiler.css +3 -0
  15. data/lib/html/rack-mini-profiler.js +2 -0
  16. data/lib/html/share.html +0 -1
  17. data/lib/html/speedscope/LICENSE +21 -0
  18. data/lib/html/speedscope/README.md +3 -0
  19. data/lib/html/speedscope/demangle-cpp.1768f4cc.js +4 -0
  20. data/lib/html/speedscope/favicon-16x16.f74b3187.png +0 -0
  21. data/lib/html/speedscope/favicon-32x32.bc503437.png +0 -0
  22. data/lib/html/speedscope/file-format-schema.json +324 -0
  23. data/lib/html/speedscope/import.cf0fa83f.js +115 -0
  24. data/lib/html/speedscope/index.html +2 -0
  25. data/lib/html/speedscope/release.txt +3 -0
  26. data/lib/html/speedscope/reset.8c46b7a1.css +2 -0
  27. data/lib/html/speedscope/source-map.438fa06b.js +24 -0
  28. data/lib/html/speedscope/speedscope.44364064.js +200 -0
  29. data/lib/html/vendor.js +848 -0
  30. data/lib/mini_profiler/asset_version.rb +3 -2
  31. data/lib/mini_profiler/client_settings.rb +27 -16
  32. data/lib/mini_profiler/config.rb +73 -46
  33. data/lib/mini_profiler/context.rb +5 -3
  34. data/lib/mini_profiler/gc_profiler.rb +17 -16
  35. data/lib/mini_profiler/profiler.rb +332 -94
  36. data/lib/mini_profiler/profiling_methods.rb +20 -15
  37. data/lib/mini_profiler/snapshots_transporter.rb +109 -0
  38. data/lib/mini_profiler/storage/abstract_store.rb +80 -0
  39. data/lib/mini_profiler/storage/file_store.rb +18 -13
  40. data/lib/mini_profiler/storage/memcache_store.rb +10 -7
  41. data/lib/mini_profiler/storage/memory_store.rb +63 -13
  42. data/lib/mini_profiler/storage/redis_store.rb +143 -7
  43. data/lib/mini_profiler/timer_struct/base.rb +4 -2
  44. data/lib/mini_profiler/timer_struct/client.rb +9 -8
  45. data/lib/mini_profiler/timer_struct/custom.rb +8 -5
  46. data/lib/mini_profiler/timer_struct/page.rb +79 -24
  47. data/lib/mini_profiler/timer_struct/request.rb +83 -38
  48. data/lib/mini_profiler/timer_struct/sql.rb +25 -22
  49. data/lib/mini_profiler/version.rb +3 -1
  50. data/lib/mini_profiler_rails/railtie.rb +91 -8
  51. data/lib/mini_profiler_rails/railtie_methods.rb +61 -0
  52. data/lib/patches/db/activerecord.rb +5 -14
  53. data/lib/patches/db/mongo.rb +3 -1
  54. data/lib/patches/db/moped.rb +5 -3
  55. data/lib/patches/db/mysql2.rb +8 -6
  56. data/lib/patches/db/neo4j.rb +3 -1
  57. data/lib/patches/db/nobrainer.rb +4 -2
  58. data/lib/patches/db/oracle_enhanced.rb +4 -2
  59. data/lib/patches/db/pg.rb +41 -21
  60. data/lib/patches/db/plucky.rb +7 -5
  61. data/lib/patches/db/riak.rb +15 -13
  62. data/lib/patches/db/rsolr.rb +6 -4
  63. data/lib/patches/db/sequel.rb +2 -0
  64. data/lib/patches/net_patches.rb +20 -8
  65. data/lib/patches/sql_patches.rb +17 -7
  66. data/lib/prepend_net_http_patch.rb +5 -0
  67. data/lib/rack-mini-profiler.rb +3 -3
  68. data/rack-mini-profiler.gemspec +23 -9
  69. metadata +146 -31
  70. data/lib/html/jquery.1.7.1.js +0 -4
  71. data/lib/html/jquery.tmpl.js +0 -486
  72. data/lib/html/list.css +0 -9
  73. data/lib/html/list.js +0 -38
  74. data/lib/html/list.tmpl +0 -34
@@ -1,20 +1,23 @@
1
- <script id="profilerTemplate" type="text/x-jquery-tmpl">
2
-
1
+ <script id="profilerTemplate" type="text/x-dot-tmpl">
3
2
  <div class="profiler-result">
4
-
5
- <div class="profiler-button {{if has_duplicate_sql_timings}}profiler-warning{{/if}}">
6
- {{if has_duplicate_sql_timings}}<span class="profiler-nuclear">!</span>{{/if}}
3
+ <div class="profiler-button {{? it.has_duplicate_sql_timings}}profiler-warning{{?}}">
4
+ {{? it.has_duplicate_sql_timings}}<span class="profiler-nuclear">!</span>{{?}}
7
5
  <span class="profiler-number">
8
- ${MiniProfiler.formatDuration(duration_milliseconds)} <span class="profiler-unit">ms</span>
6
+ {{= MiniProfiler.formatDuration(it.duration_milliseconds)}} <span class="profiler-unit">ms</span>
9
7
  </span>
8
+ {{? MiniProfiler.showTotalSqlCount()}}
9
+ <span class="profiler-number">
10
+ {{= it.sql_count}} <span class="profiler-unit">sql</span>
11
+ </span>
12
+ {{?}}
10
13
  </div>
11
14
 
12
15
  <div class="profiler-popup">
13
16
  <div class="profiler-info">
14
17
  <span class="profiler-name">
15
- ${name} <span class="profiler-overall-duration">(${MiniProfiler.formatDuration(duration_milliseconds)} ms)</span>
18
+ {{= it.name}} <span class="profiler-overall-duration">({{= MiniProfiler.formatDuration(it.duration_milliseconds)}} ms)</span>
16
19
  </span>
17
- <span class="profiler-server-time">${machine_name} on ${MiniProfiler.renderDate(started)}</span>
20
+ <span class="profiler-server-time">{{= it.machine_name}} on {{= MiniProfiler.renderDate(it.started_formatted)}}</span>
18
21
  </div>
19
22
  <div class="profiler-output">
20
23
  <table class="profiler-timings">
@@ -24,200 +27,282 @@
24
27
  <th>duration (ms)</th>
25
28
  <th class="profiler-duration-with-children">with children (ms)</th>
26
29
  <th class="time-from-start">from start (ms)</th>
27
- {{if has_sql_timings}}
30
+ {{? it.has_sql_timings}}
28
31
  <th colspan="2">query time (ms)</th>
29
- {{/if}}
30
- {{each custom_timing_names}}
31
- <th colspan="2">${$value.toLowerCase()} (ms)</th>
32
- {{/each}}
32
+ {{?}}
33
+ {{~ it.custom_timing_names :value}}
34
+ <th colspan="2">{{= value.toLowerCase() }} (ms)</th>
35
+ {{~}}
33
36
  </tr>
34
37
  </thead>
35
38
  <tbody>
36
- {{tmpl({timing:root, page:this.data}) "#timingTemplate"}}
39
+ {{= MiniProfiler.templates.timingTemplate({timing: it.root, page: it}) }}
37
40
  </tbody>
38
41
  <tfoot>
39
42
  <tr>
40
43
  <td colspan="3">
41
- {{if !client_timings}}
42
- {{tmpl "#linksTemplate"}}
43
- {{/if}}
44
+ {{? !it.client_timings}}
45
+ {{= MiniProfiler.templates.linksTemplate({timing: it.root, page: it}) }}
46
+ {{?}}
44
47
  <a class="profiler-toggle-duration-with-children" title="toggles column with aggregate child durations">show time with children</a>
48
+ <a
49
+ class="profiler-snapshots-page-link"
50
+ title="Go to snapshots page"
51
+ href="{{= MiniProfiler.options.path }}snapshots">snapshots</a>
45
52
  </td>
46
- {{if has_sql_timings}}
47
- <td colspan="2" class="profiler-number profiler-percent-in-sql" title="${MiniProfiler.getSqlTimingsCount(root)} queries spent ${MiniProfiler.formatDuration(duration_milliseconds_in_sql)} ms of total request time">
48
- ${MiniProfiler.formatDuration(duration_milliseconds_in_sql / duration_milliseconds * 100)}
49
- <span class="profiler-unit">% in sql</span>
50
- </td>
51
- {{/if}}
52
- {{each custom_timing_names}}
53
- <td colspan="2" class="profiler-number profiler-percentage-in-sql" title="${custom_timing_stats[$value].count} ${$value.toLowerCase()} invocations spent ${MiniProfiler.formatDuration(custom_timing_stats[$value].duration)} ms of total request time">
54
- ${MiniProfiler.formatDuration(custom_timing_stats[$value].duration / duration_milliseconds * 100)}
55
- <span class="profiler-unit">% in ${$value.toLowerCase()}</span>
56
- </td>
57
- {{/each}}
53
+ {{? it.has_sql_timings}}
54
+ <td colspan="2" class="profiler-number profiler-percent-in-sql" title="{{= MiniProfiler.getSqlTimingsCount(it.root) }} queries spent {{= MiniProfiler.formatDuration(it.duration_milliseconds_in_sql) }} ms of total request time">
55
+ {{= MiniProfiler.formatDuration(it.duration_milliseconds_in_sql / it.duration_milliseconds * 100) }}
56
+ <span class="profiler-unit">% in sql</span>
57
+ </td>
58
+ {{?}}
59
+ {{~ it.custom_timing_names :value}}
60
+ <td colspan="2" class="profiler-number profiler-percentage-in-sql" title="{{= it.custom_timing_stats[value].count }} {{= value.toLowerCase() }} invocations spent {{= MiniProfiler.formatDuration(it.custom_timing_stats[value].duration) }} ms of total request time">
61
+ {{= MiniProfiler.formatDuration(it.custom_timing_stats[value].duration / it.duration_milliseconds * 100) }}
62
+ <span class="profiler-unit">% in {{= value.toLowerCase() }}</span>
63
+ </td>
64
+ {{~}}
58
65
  </tr>
59
66
  </tfoot>
60
67
  </table>
61
- {{if client_timings}}
62
- <table class="profiler-timings profiler-client-timings">
63
- <thead>
64
- <tr>
65
- <th>client event</th>
66
- <th>duration (ms)</th>
67
- <th>from start (ms)</th>
68
- </tr>
69
- </thead>
70
- <tbody>
71
- {{each MiniProfiler.getClientTimings(client_timings)}}
72
- <tr class="{{if $value.isTrivial }}profiler-trivial{{/if}}">
73
- <td class="profiler-label">${$value.name}</td>
74
- <td class="profiler-duration">
75
- {{if $value.duration >= 0}}
76
- <span class="profiler-unit"></span>${MiniProfiler.formatDuration($value.duration)}
77
- {{/if}}
78
- </td>
79
- <td class="profiler-duration time-from-start">
80
- <span class="profiler-unit">+</span>${MiniProfiler.formatDuration($value.start)}
68
+ {{? it.client_timings}}
69
+ <table class="profiler-timings profiler-client-timings">
70
+ <thead>
71
+ <tr>
72
+ <th>client event</th>
73
+ <th>duration (ms)</th>
74
+ <th>from start (ms)</th>
75
+ </tr>
76
+ </thead>
77
+ <tbody>
78
+ {{~ MiniProfiler.getClientTimings(it.client_timings) :value}}
79
+ <tr class="{{? value.isTrivial }}profiler-trivial{{?}}">
80
+ <td class="profiler-label">{{= value.name }}</td>
81
+ <td class="profiler-duration">
82
+ {{? value.duration >= 0}}
83
+ <span class="profiler-unit"></span>{{= MiniProfiler.formatDuration(value.duration) }}
84
+ {{?}}
85
+ </td>
86
+ <td class="profiler-duration time-from-start">
87
+ <span class="profiler-unit">+</span>{{= MiniProfiler.formatDuration(value.start) }}
88
+ </td>
89
+ </tr>
90
+ {{~}}
91
+ </tbody>
92
+ <tfoot>
93
+ <td colspan="3">
94
+ {{= MiniProfiler.templates.linksTemplate({timing: it.root, page: it}) }}
81
95
  </td>
82
- </tr>
83
- {{/each}}
84
- </tbody>
85
- <tfoot>
86
- <td colspan="3">
87
- {{tmpl "#linksTemplate"}}
88
- </td>
89
- </tfoot>
90
- </table>
91
- {{/if}}
96
+ </tfoot>
97
+ </table>
98
+ {{?}}
99
+ {{? it.custom_fields && Object.keys(it.custom_fields).length > 0 }}
100
+ <p class="custom-fields-title">Snapshot custom fields</p>
101
+ <table class="profiler-timings">
102
+ <tbody>
103
+ {{~ Object.keys(it.custom_fields) :key }}
104
+ <tr>
105
+ <td class="profiler-label">{{= key }}</td>
106
+ <td class="profiler-label">{{= it.custom_fields[key] }}</td>
107
+ </tr>
108
+ {{~}}
109
+ </tbody>
110
+ </table>
111
+ {{?}}
92
112
  </div>
93
113
  </div>
94
114
 
95
- {{if has_sql_timings}}
96
- <div class="profiler-queries">
97
- <table>
98
- <thead>
99
- <tr>
100
- <th style="text-align:right">step<br />time from start<br />query type<br />duration</th>
101
- <th style="text-align:left">call stack<br />query</th>
102
- </tr>
103
- </thead>
104
- <tbody>
105
- {{each(i, s) MiniProfiler.getSqlTimings(root)}}
106
- {{tmpl({ g:s.prevGap }) "#sqlGapTemplate"}}
107
- {{tmpl({ i:i, s:s }) "#sqlTimingTemplate"}}
108
- {{if s.nextGap}}
109
- {{tmpl({ g:s.nextGap }) "#sqlGapTemplate"}}
110
- {{/if}}
111
- {{/each}}
112
- </tbody>
113
- </table>
114
- <p class="profiler-trivial-gap-container">
115
- <a class="profiler-toggle-trivial-gaps" href="#">show trivial gaps</a>
116
- </p>
117
- </div>
118
- {{/if}}
119
-
115
+ {{? it.has_sql_timings}}
116
+ <div class="profiler-queries">
117
+ <table>
118
+ <thead>
119
+ <tr>
120
+ <th style="text-align:right">step<br />time from start<br />query type<br />duration</th>
121
+ <th style="text-align:left">call stack<br />query</th>
122
+ </tr>
123
+ </thead>
124
+ <tbody>
125
+ {{~ MiniProfiler.getSqlTimings(it.root) :value:index}}
126
+ {{= MiniProfiler.templates.sqlGapTemplate({g: value.prevGap}) }}
127
+ {{= MiniProfiler.templates.sqlTimingTemplate({i: index, s: value}) }}
128
+ {{? value.nextGap}}
129
+ {{= MiniProfiler.templates.sqlGapTemplate({g: value.nextGap}) }}
130
+ {{?}}
131
+ {{~}}
132
+ </tbody>
133
+ </table>
134
+ <p class="profiler-trivial-gap-container">
135
+ <a class="profiler-toggle-trivial-gaps">show trivial gaps</a>
136
+ </p>
137
+ </div>
138
+ {{?}}
120
139
  </div>
121
-
122
140
  </script>
123
141
 
124
- <script id="linksTemplate" type="text/x-jquery-tmpl">
125
- <a href="${MiniProfiler.shareUrl(id)}" class="profiler-share-profiler-results" target="_blank">share</a>
126
- <a href="${MiniProfiler.moreUrl()}" class="profiler-more-actions">more</a>
127
- {{if custom_link}}
128
- <a href="${custom_link}" class="profiler-custom-link" target="_blank">${custom_link_name}</a>
129
- {{/if}}
130
- {{if has_trivial_timings}}
131
- <a class="profiler-toggle-trivial" data-show-on-load="${has_all_trivial_timings}" title="toggles any rows with &lt; ${trivial_duration_threshold_milliseconds} ms">
132
- show trivial
133
- </a>
134
- {{/if}}
142
+ <script id="linksTemplate" type="text/x-dot-tmpl">
143
+ <a href="{{= MiniProfiler.shareUrl(it.page.id) }}" class="profiler-share-profiler-results" target="_blank">share</a>
144
+ <a href="{{= MiniProfiler.moreUrl(it.timing.name) }}" class="profiler-more-actions">more</a>
145
+ {{? it.custom_link}}
146
+ <a href="{{= it.custom_link }}" class="profiler-custom-link" target="_blank">{{= it.custom_link_name }}</a>
147
+ {{?}}
148
+ {{? it.page.has_trivial_timings}}
149
+ <a class="profiler-toggle-trivial" data-show-on-load="{{= it.page.has_all_trivial_timings }}" title="toggles any rows with &lt; {{= it.page.trivial_duration_threshold_milliseconds }} ms">
150
+ show trivial
151
+ </a>
152
+ {{?}}
135
153
  </script>
136
154
 
137
- <script id="timingTemplate" type="text/x-jquery-tmpl">
138
-
139
- <tr class="{{if timing.is_trivial }}profiler-trivial{{/if}}" data-timing-id="${timing.id}">
140
- <td class="profiler-label" title="{{if timing.name && timing.name.length > 45 }}${timing.name}{{/if}}">
141
- <span class="profiler-indent">${MiniProfiler.renderIndent(timing.depth)}</span> ${timing.name.slice(0,45)}{{if timing.name && timing.name.length > 45 }}...{{/if}}
155
+ <script id="timingTemplate" type="text/x-dot-tmpl">
156
+ <tr class="{{? it.timing.is_trivial }}profiler-trivial{{?}}" data-timing-id="{{= it.timing.id }}">
157
+ <td class="profiler-label" title="{{? it.timing.name && it.timing.name.length > 45 }}{{= it.timing.name }}{{?}}">
158
+ <span class="profiler-indent">{{= MiniProfiler.renderIndent(it.timing.depth) }}</span> {{= it.timing.name.slice(0,45) }}{{? it.timing.name && it.timing.name.length > 45 }}...{{?}}
142
159
  </td>
143
160
  <td class="profiler-duration" title="duration of this step without any children's durations">
144
- ${MiniProfiler.formatDuration(timing.duration_without_children_milliseconds)}
161
+ {{= MiniProfiler.formatDuration(it.timing.duration_without_children_milliseconds) }}
145
162
  </td>
146
163
  <td class="profiler-duration profiler-duration-with-children" title="duration of this step and its children">
147
- ${MiniProfiler.formatDuration(timing.duration_milliseconds)}
164
+ {{= MiniProfiler.formatDuration(it.timing.duration_milliseconds) }}
148
165
  </td>
149
166
  <td class="profiler-duration time-from-start" title="time elapsed since profiling started">
150
- <span class="profiler-unit">+</span>${MiniProfiler.formatDuration(timing.start_milliseconds)}
167
+ <span class="profiler-unit">+</span>{{= MiniProfiler.formatDuration(it.timing.start_milliseconds) }}
151
168
  </td>
152
169
 
153
- {{if timing.has_sql_timings}}
154
- <td class="profiler-duration {{if timing.has_duplicate_sql_timings}}profiler-warning{{/if}}" title="{{if timing.has_duplicate_sql_timings}}duplicate queries detected - {{/if}}{{if timing.executed_readers > 0 || timing.executed_scalars > 0 || timing.executed_non_queries > 0}}${timing.executed_readers} reader, ${timing.executed_scalars} scalar, ${timing.executed_non_queries} non-query statements executed{{/if}}">
170
+ {{? it.timing.has_sql_timings}}
171
+ <td class="profiler-duration {{? it.timing.has_duplicate_sql_timings}}profiler-warning{{?}}" title="{{? it.timing.has_duplicate_sql_timings}}duplicate queries detected - {{?}}{{? it.timing.executed_readers > 0 || it.timing.executed_scalars > 0 || it.timing.executed_non_queries > 0}}{{= it.timing.executed_readers }} reader, {{= it.timing.executed_scalars }} scalar, {{= it.timing.executed_non_queries }} non-query statements executed{{?}}">
155
172
  <a class="profiler-queries-show">
156
- {{if timing.has_duplicate_sql_timings}}<span class="profiler-nuclear">!</span>{{/if}}
157
- ${timing.sql_timings.length} <span class="profiler-unit">sql</span>
173
+ {{? it.timing.has_duplicate_sql_timings}}<span class="profiler-nuclear">!</span>{{?}}
174
+ {{= it.timing.sql_timings.length }} <span class="profiler-unit">sql</span>
158
175
  </a>
159
176
  </td>
160
177
  <td class="profiler-duration" title="aggregate duration of all queries in this step (excludes children)">
161
- ${MiniProfiler.formatDuration(timing.sql_timings_duration_milliseconds)}
178
+ {{= MiniProfiler.formatDuration(it.timing.sql_timings_duration_milliseconds) }}
162
179
  </td>
163
- {{else}}
180
+ {{??}}
164
181
  <td colspan="2"></td>
165
- {{/if}}
182
+ {{?}}
166
183
 
167
- {{each page.custom_timing_names}}
168
- {{if timing.custom_timings && timing.custom_timings[$value]}}
169
- <td class="profiler-duration" title="aggregate number of all ${$value.toLowerCase()} invocations in this step (excludes children)">
170
- ${timing.custom_timings[$value].length} ${$value.toLowerCase()}
184
+ {{~ it.page.custom_timing_names :value}}
185
+ {{? it.timing.custom_timings && it.timing.custom_timings[value]}}
186
+ <td class="profiler-duration" title="aggregate number of all {{= value.toLowerCase() }} invocations in this step (excludes children)">
187
+ {{= it.timing.custom_timings[value].length }} {{= value.toLowerCase() }}
171
188
  </td>
172
- <td class="profiler-duration" title="aggregate duration of all ${$value.toLowerCase()} invocations in this step (excludes children)">
173
- ${MiniProfiler.formatDuration(timing.custom_timing_stats[$value].duration)}
189
+ <td class="profiler-duration" title="aggregate duration of all {{= value.toLowerCase() }} invocations in this step (excludes children)">
190
+ {{= MiniProfiler.formatDuration(it.timing.custom_timing_stats[value].duration) }}
174
191
  </td>
175
- {{else}}
192
+ {{??}}
176
193
  <td colspan="2"></td>
177
- {{/if}}
178
- {{/each}}
194
+ {{?}}
195
+ {{~}}
179
196
 
180
197
  </tr>
181
198
 
182
- {{if timing.has_children}}
183
- {{each timing.children}}
184
- {{tmpl({timing: $value, page: page}) "#timingTemplate"}}
185
- {{/each}}
186
- {{/if}}
187
-
199
+ {{? it.timing.has_children}}
200
+ {{~ it.timing.children :value}}
201
+ {{= MiniProfiler.templates.timingTemplate({timing: value, page: it.page}) }}
202
+ {{~}}
203
+ {{?}}
188
204
  </script>
189
205
 
190
- <script id="sqlTimingTemplate" type="text/x-jquery-tmpl">
191
-
192
- <tr class="${s.row_class}" data-timing-id="${s.parent_timing_id}">
206
+ <script id="sqlTimingTemplate" type="text/x-dot-tmpl">
207
+ <tr class="{{= it.s.row_class || '' }}" data-timing-id="{{= it.s.parent_timing_id }}">
193
208
  <td class="profiler-info">
194
- <div>${s.parent_timing_name}</div>
195
- <div class="profiler-number"><span class="profiler-unit">T+</span>${MiniProfiler.formatDuration(s.start_milliseconds)} <span class="profiler-unit">ms</span></div>
209
+ <div>{{= it.s.parent_timing_name }}</div>
210
+ <div class="profiler-number"><span class="profiler-unit">T+</span>{{= MiniProfiler.formatDuration(it.s.start_milliseconds) }} <span class="profiler-unit">ms</span></div>
196
211
  <div>
197
- {{if s.is_duplicate}}<span class="profiler-warning">DUPLICATE</span>{{/if}}
198
- ${MiniProfiler.renderExecuteType(s.execute_type)}
212
+ {{? it.s.is_duplicate}}<span class="profiler-warning">DUPLICATE</span>{{?}}
213
+ {{= MiniProfiler.renderExecuteType(it.s.execute_type) }}
199
214
  </div>
200
- <div title="{{if s.execute_type == 3}}first result fetched: ${s.first_fetch_duration_milliseconds}ms{{/if}}">${MiniProfiler.formatDuration(s.duration_milliseconds)} <span class="profiler-unit">ms</span></div>
215
+ <div title="{{? it.s.execute_type == 3}}first result fetched: {{= it.s.first_fetch_duration_milliseconds }}ms{{?}}">{{= MiniProfiler.formatDuration(it.s.duration_milliseconds) }} <span class="profiler-unit">ms</span></div>
201
216
  </td>
202
217
  <td>
203
218
  <div class="query">
204
- <pre class="profiler-stack-trace">${s.stack_trace_snippet}</pre>
205
- <pre class="prettyprint lang-sql"><code>${s.formatted_command_string}; ${MiniProfiler.formatParameters(s.parameters)}</code></pre>
219
+ <pre class="profiler-stack-trace">{{= it.s.stack_trace_snippet }}</pre>
220
+ {{? it.s.formatted_command_string}}
221
+ <pre class="prettyprint lang-sql"><code>{{= it.s.formatted_command_string }}; {{= MiniProfiler.formatParameters(it.s.parameters) }}</code></pre>
222
+ {{??}}
223
+ <i>Query redacted</i>
224
+ {{?}}
206
225
  </div>
207
226
  </td>
208
227
  </tr>
209
-
210
228
  </script>
211
229
 
212
- <script id="sqlGapTemplate" type="text/x-jquery-tmpl">
213
-
214
- <tr class="profiler-gap-info{{if g.duration < 4}} profiler-trivial-gaps{{/if}}">
230
+ <script id="sqlGapTemplate" type="text/x-dot-tmpl">
231
+ <tr class="profiler-gap-info{{? it.g.duration < 4}} profiler-trivial-gaps{{?}}">
215
232
  <td class="profiler-info">
216
- ${g.duration} <span class="profiler-unit">ms</span>
233
+ {{= it.g.duration }} <span class="profiler-unit">ms</span>
217
234
  </td>
218
235
  <td class="query">
219
- <div>${g.topReason.name} &mdash; ${g.topReason.duration.toFixed(2)} <span class="profiler-unit">ms</span></div>
236
+ <div>{{= it.g.topReason.name }} &mdash; {{= it.g.topReason.duration.toFixed(2) }} <span class="profiler-unit">ms</span></div>
220
237
  </td>
221
238
  </tr>
239
+ </script>
222
240
 
241
+ <script id="snapshotsGroupsList" type="text/x-dot-tmpl">
242
+ {{? it.list && it.list.length }}
243
+ <table class="snapshots-table">
244
+ <thead>
245
+ <tr>
246
+ <th>Requests Group</th>
247
+ <th>Worst Time (ms)</th>
248
+ <th>Best Time (ms)</th>
249
+ <th>No. of Snapshots</th>
250
+ </tr>
251
+ </thead>
252
+ <tbody>
253
+ {{~ it.list :row}}
254
+ <tr>
255
+ <td class="request-group"><a href="{{= row.url }}">{{= row.name }}</a></td>
256
+ <td>{{= MiniProfiler.formatDuration(row.worst_score) }}</td>
257
+ <td>{{= MiniProfiler.formatDuration(row.best_score) }}</td>
258
+ <td>{{= row.snapshots_count }}</td>
259
+ </tr>
260
+ {{~}}
261
+ </tbody>
262
+ </table>
263
+ {{??}}
264
+ <h2>No snapshots exist</h2>
265
+ {{?}}
266
+ </script>
267
+
268
+ <script id="snapshotsList" type="text/x-dot-tmpl">
269
+ {{ var data = it.data; }}
270
+ {{ var customFieldsNames = it.allCustomFieldsNames; }}
271
+ {{? data.list && data.list.length }}
272
+ <h2>Snapshots for {{= data.group_name }}</h2>
273
+ <table class="snapshots-table">
274
+ <thead>
275
+ <tr>
276
+ <th>ID</th>
277
+ <th>Duration (ms)</th>
278
+ <th>SQL Count</th>
279
+ {{~ customFieldsNames :name }}
280
+ <th>{{= name }}</th>
281
+ {{~}}
282
+ <th>Age</th>
283
+ </tr>
284
+ </thead>
285
+ <tbody>
286
+ {{~ data.list :row}}
287
+ <tr>
288
+ <td><a href="{{= row.url }}">
289
+ {{= row.id }}
290
+ </a></td>
291
+ <td>{{= MiniProfiler.formatDuration(row.duration) }}</td>
292
+ <td>{{= row.sql_count }}</td>
293
+ {{~ customFieldsNames :name }}
294
+ <td>{{= row.custom_fields[name] || "" }}</td>
295
+ {{~}}
296
+ <td>
297
+ {{? row.timestamp }}
298
+ {{= MiniProfiler.timestampToRelative(row.timestamp) }}
299
+ {{?}}
300
+ </td>
301
+ </tr>
302
+ {{~}}
303
+ </tbody>
304
+ </table>
305
+ {{??}}
306
+ <h2>No snapshots for {{= data.group_name }}</h2>
307
+ {{?}}
223
308
  </script>