This repository has been archived by the owner on Sep 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
includes.tmpl
238 lines (216 loc) · 9.93 KB
/
includes.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<script id="profilerTemplate" type="text/x-jquery-tmpl">
<div class="profiler-result">
<div class="profiler-button <% if (HasDuplicateCustomTimings) { %>profiler-warning<% } %>" title="<%= Name %>">
<span class="profiler-number">
<%= MiniProfiler.formatDuration(DurationMilliseconds) %> <span class="profiler-unit">ms</span>
</span>
<% if (HasDuplicateCustomTimings) { %><span class="profiler-nuclear">!</span><% } %>
</div>
<div class="profiler-popup">
<div class="profiler-info">
<span class="profiler-name">
<%= Name %> <span class="profiler-overall-duration">(<%= MiniProfiler.formatDuration(DurationMilliseconds) %> ms)</span>
</span>
<span class="profiler-server-time"><%= MachineName %> on <%= Started ? Started.toUTCString() : '' %></span>
</div>
<div class="profiler-output">
<table class="profiler-timings">
<thead>
<tr>
<th></th>
<th title="in milliseconds">duration</th>
<th class="profiler-show-more" title="in milliseconds">with children</th>
<th class="time-from-start profiler-show-more" title="in milliseconds">from start</th>
<% _.each(CustomTimingStats, function($stat, $name) { %>
<th title="in milliseconds (call count)"><%= $name.toLowerCase() %></th>
<% }); %>
</tr>
</thead>
<tbody>
<%= MiniProfiler.tmpl("#timingTemplate", {timing:Root, page:_self}) %>
</tbody>
<tfoot>
<tr>
<td colspan="2"></td>
<td class="profiler-show-more" colspan="2"></td>
</tr>
</tfoot>
</table>
<% if (HasCustomTimings) { %>
<table class="profiler-custom-timing-overview">
<% _.each(CustomTimingStats, function($stat, $name) { %>
<tr title="<%= $stat.Count %> <%= $name.toLowerCase() %> calls spent <%= MiniProfiler.formatDuration($stat.Duration) %> ms of total request time">
<td class="profiler-number">
<%= $name %>:
</td>
<td class="profiler-number">
<%= MiniProfiler.formatDuration($stat.Duration / DurationMilliseconds * 100) %> <span class="profiler-unit">%</span>
</td>
</tr>
<% }); %>
</table>
<% } %>
<% if (ClientTimings) { %>
<table class="profiler-timings profiler-client-timings">
<thead>
<tr>
<th style="text-align:left">client event</th>
<th>duration</th>
<th class="profiler-show-more">from start</th>
</tr>
</thead>
<tbody>
<% _.each(MiniProfiler.getClientTimings(ClientTimings), function($value) { %>
<tr class="<% if ($value.isTrivial ) { %>profiler-trivial<% } %>">
<td class="profiler-label"><%= $value.name %></td>
<td class="profiler-duration">
<% if ($value.duration >= 0) { %>
<span class="profiler-unit"></span><%= MiniProfiler.formatDuration($value.duration) %>
<% } %>
</td>
<td class="profiler-duration time-from-start profiler-show-more">
<span class="profiler-unit">+</span><%= MiniProfiler.formatDuration($value.start) %>
</td>
</tr>
<% }); %>
</tbody>
</table>
<% } %>
<div class="profiler-links">
<a href="<%= MiniProfiler.shareUrl(Id) %>" class="profiler-share-profiler-results" target="_blank">share</a>
<% _.each(CustomLinks, function($link, $name) { %>
<a href="<%= $link %>" class="profiler-custom-link" target="_blank"><%= $name %></a>
<% }); %>
<span class="profiler-toggleable-links">
<a class="profiler-toggle-hidden-columns" data-toggle-class="profiler-show-more" data-hide-text="fewer columns">
more columns
</a>
<% if (HasTrivialTimings) { %>
<a class="profiler-toggle-trivial" data-toggle-class="profiler-trivial" data-hide-text="hide trivial" title="toggles any rows with < <%= TrivialMilliseconds %> ms duration">
show trivial
</a>
<% } %>
</span>
</div>
</div>
</div>
<% if (HasCustomTimings) { %>
<div class="profiler-queries">
<table>
<thead>
<tr>
<th style="text-align:right">step<br />time from start<br />call type<br />duration</th>
<th style="text-align:left">call stack<br />call</th>
</tr>
</thead>
<tbody>
<% _.each(MiniProfiler.getCustomTimings(Root), function(s, i) { %>
<%= MiniProfiler.tmpl("#customGapTemplate", {g:s.prevGap}) %>
<%= MiniProfiler.tmpl("#customTimingTemplate", {i:i, s:s}) %>
<% if (s.nextGap) { %>
<%= MiniProfiler.tmpl("#customGapTemplate", {g:s.nextGap}) %>
<% } %>
<% }); %>
</tbody>
</table>
<p class="profiler-trivial-gap-container">
<a class="profiler-toggle-trivial-gaps" href="#">show trivial gaps</a>
</p>
</div>
<% } %>
</div>
</script>
<script id="timingTemplate" type="text/x-jquery-tmpl">
<tr class="<%= timing.IsTrivial ? 'profiler-trivial' : '' %>" data-timing-id="<%= timing.Id %>">
<td class="profiler-label" title="<% if (timing.Name && timing.Name.length > 45 ) { %><%= MiniProfiler.safeHtml(timing.Name) %><% } %>">
<span class="profiler-indent"><%= MiniProfiler.renderIndent(timing.Depth) %></span> <%= MiniProfiler.safeHtml(timing.Name.slice(0,45)) %><% if (timing.Name && timing.Name.length > 45 ) { %>...<% } %>
</td>
<td class="profiler-duration" title="duration of this step without any children's durations">
<%= MiniProfiler.formatDuration(timing.DurationWithoutChildrenMilliseconds) %>
</td>
<td class="profiler-duration profiler-show-more" title="duration of this step and its children">
<%= MiniProfiler.formatDuration(timing.DurationMilliseconds) %>
</td>
<td class="profiler-duration profiler-show-more time-from-start" title="time elapsed since profiling started">
<span class="profiler-unit">+</span><%= MiniProfiler.formatDuration(timing.StartMilliseconds) %>
</td>
<% _.each(page && page.CustomTimingStats, function($stat, $name) { %>
<% if (timing.CustomTimings[$name]) { %>
<td class="profiler-duration <%= timing.HasDuplicateCustomTimings[$name] ? 'profiler-warning' : '' %>">
<a class="profiler-queries-show" title="<%= MiniProfiler.formatDuration(timing.CustomTimingStats[$name].Duration) %> ms in <%= timing.CustomTimings[$name].length %> <%= $name %> calls<%= timing.HasDuplicateCustomTimings[$name] ? '; duplicate calls detected!': '' %>">
<%= MiniProfiler.formatDuration(timing.CustomTimingStats[$name].Duration) %>
(<%= timing.CustomTimings[$name].length %><% if (timing.HasDuplicateCustomTimings[$name]) { %><span class="profiler-nuclear">!</span><% } %>)
</a>
</td>
<% } else { %>
<td></td>
<% } %>
<% }); %>
</tr>
<% _.each(timing.Children, function($child) { %>
<%= MiniProfiler.tmpl("#timingTemplate", {timing: $child, page: page}) %>
<% }); %>
</script>
<script id="customTimingTemplate" type="text/x-jquery-tmpl">
<tr class="<% if (i % 2 == 1) { %>profiler-odd<% } %>" data-timing-id="<%= s.ParentTimingId %>">
<td class="profiler-info">
<div><%= s.ParentTimingName %></div>
<div class="profiler-number"><span class="profiler-unit">T+</span><%= MiniProfiler.formatDuration(s.StartMilliseconds) %> <span class="profiler-unit">ms</span></div>
<div>
<% if (s.IsDuplicate) { %><span class="profiler-warning">DUPLICATE</span><% } %>
<%= s.CallType %><%= !s.ExecuteType || s.CallType == s.ExecuteType ? "" : " - " + s.ExecuteType %>
</div>
<div title="<% if (s.FirstFetchDurationMilliseconds) { %>first result fetched: <%= s.FirstFetchDurationMilliseconds %>ms<% } %>"><%= MiniProfiler.formatDuration(s.DurationMilliseconds) %> <span class="profiler-unit">ms</span></div>
</td>
<td>
<div class="query">
<pre class="profiler-stack-trace"><%= s.StackTraceSnippet %></pre>
<pre class="prettyprint lang-<%= s.CallType %>"><code><%= _.escape(s.CommandString) %></code></pre>
</div>
</td>
</tr>
</script>
<script id="customGapTemplate" type="text/x-jquery-tmpl">
<tr class="profiler-gap-info<% if (g.duration < 4) { %> profiler-trivial-gaps<% } %>">
<td class="profiler-info">
<%= g.duration %> <span class="profiler-unit">ms</span>
</td>
<td class="query">
<div><%= g.topReason.name %> — <%= g.topReason.duration.toFixed(2) %> <span class="profiler-unit">ms</span></div>
</td>
</tr>
</script>
<script id="tableTemplate" type="text/x-jquery-tmpl">
<table class="profiler-results-index">
<thead>
<tr>
<th>Name</th>
<th>Started</th>
<th>Sql Duration</th>
<th>Total Duration</th>
<th>Request Start</th>
<th>Response Start</th>
<th>Dom Complete</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</script>
<script id="rowTemplate" type="text/x-jquery-tmpl">
<tr>
<td>
<a href="${MiniProfiler.path}results?id=${Id}">${Name}</a>
</td>
<td class="profiler-results-index-date">${MiniProfiler.renderDate(Started)}</td>
<td class="profiler-results-index-time">${DurationMillisecondsInSql}</td>
<td class="profiler-results-index-time">${DurationMilliseconds}</td>
{{if ClientTimings}}
<td class="profiler-results-index-time">${MiniProfiler.getClientTimingByName(ClientTimings,"Request").Start}</td>
<td class="profiler-results-index-time">${MiniProfiler.getClientTimingByName(ClientTimings,"Response").Start}</td>
<td class="profiler-results-index-time">${MiniProfiler.getClientTimingByName(ClientTimings,"Dom Complete").Start}</td>
{{else}}
<td colspan="3"></td>
{{/if}}
</tr>
</script>