rack-mini-profiler 1.0.2 → 3.1.1

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