1<script id="profilerTemplate" type="text/x-jquery-tmpl"> 2 3 <div class="profiler-result"> 4 5 <div class="profiler-button {{if HasDuplicateSqlTimings}}profiler-warning{{/if}}"> 6 {{if HasDuplicateSqlTimings}}<span class="profiler-nuclear">!</span>{{/if}} 7 <span class="profiler-number"> 8 ${MiniProfiler.formatDuration(DurationMilliseconds)} <span class="profiler-unit">ms</span> 9 </span> 10 </div> 11 12 <div class="profiler-popup"> 13 <div class="profiler-info"> 14 <span class="profiler-name"> 15 ${Name} <span class="profiler-overall-duration">(${MiniProfiler.formatDuration(DurationMilliseconds)} ms)</span> 16 </span> 17 <span class="profiler-server-time">${MachineName} on ${MiniProfiler.renderDate(Started)}</span> 18 </div> 19 <div class="profiler-output"> 20 <table class="profiler-timings"> 21 <thead> 22 <tr> 23 <th></th> 24 <th>duration (ms)</th> 25 <th class="profiler-duration-with-children">with children (ms)</th> 26 <th class="time-from-start">from start (ms)</th> 27 {{if HasSqlTimings}} 28 <th colspan="2">query time (ms)</th> 29 {{/if}} 30 {{each CustomTimingNames}} 31 <th colspan="2">${$value.toLowerCase()} (ms)</th> 32 {{/each}} 33 </tr> 34 </thead> 35 <tbody> 36 {{tmpl({timing:Root, page:this.data}) "#timingTemplate"}} 37 </tbody> 38 <tfoot> 39 <tr> 40 <td colspan="3"> 41 {{if !ClientTimings}} 42 {{tmpl "#linksTemplate"}} 43 {{/if}} 44 <a class="profiler-toggle-duration-with-children" title="toggles column with aggregate child durations">show time with children</a> 45 </td> 46 {{if HasSqlTimings}} 47 <td colspan="2" class="profiler-number profiler-percent-in-sql" title="${MiniProfiler.getSqlTimingsCount(Root)} queries spent ${MiniProfiler.formatDuration(DurationMillisecondsInSql)} ms of total request time"> 48 ${MiniProfiler.formatDuration(DurationMillisecondsInSql / DurationMilliseconds * 100)} 49 <span class="profiler-unit">% in sql</span> 50 </td> 51 {{/if}} 52 {{each CustomTimingNames}} 53 <td colspan="2" class="profiler-number profiler-percentage-in-sql" title="${CustomTimingStats[$value].Count} ${$value.toLowerCase()} invocations spent ${MiniProfiler.formatDuration(CustomTimingStats[$value].Duration)} ms of total request time"> 54 ${MiniProfiler.formatDuration(CustomTimingStats[$value].Duration / DurationMilliseconds * 100)} 55 <span class="profiler-unit">% in ${$value.toLowerCase()}</span> 56 </td> 57 {{/each}} 58 </tr> 59 </tfoot> 60 </table> 61 {{if ClientTimings}} 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(ClientTimings)}} 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)} 81 </td> 82 </tr> 83 {{/each}} 84 </tbody> 85 <tfoot> 86 <td colspan="3"> 87 {{tmpl "#linksTemplate"}} 88 </td> 89 </tfoot> 90 </table> 91 {{/if}} 92 </div> 93 </div> 94 95 {{if HasSqlTimings}} 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 120 </div> 121 122</script> 123 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 {{if CustomLink}} 127 <a href="${CustomLink}" class="profiler-custom-link" target="_blank">${CustomLinkName}</a> 128 {{/if}} 129 {{if HasTrivialTimings}} 130 <a class="profiler-toggle-trivial" data-show-on-load="${HasAllTrivialTimings}" title="toggles any rows with < ${TrivialDurationThresholdMilliseconds} ms"> 131 show trivial 132 </a> 133 {{/if}} 134</script> 135 136<script id="timingTemplate" type="text/x-jquery-tmpl"> 137 138 <tr class="{{if timing.IsTrivial }}profiler-trivial{{/if}}" data-timing-id="${timing.Id}"> 139 <td class="profiler-label" title="{{if timing.Name && timing.Name.length > 45 }}${timing.Name}{{/if}}"> 140 <span class="profiler-indent">${MiniProfiler.renderIndent(timing.Depth)}</span> ${timing.Name.slice(0,45)}{{if timing.Name && timing.Name.length > 45 }}...{{/if}} 141 </td> 142 <td class="profiler-duration" title="duration of this step without any children's durations"> 143 ${MiniProfiler.formatDuration(timing.DurationWithoutChildrenMilliseconds)} 144 </td> 145 <td class="profiler-duration profiler-duration-with-children" title="duration of this step and its children"> 146 ${MiniProfiler.formatDuration(timing.DurationMilliseconds)} 147 </td> 148 <td class="profiler-duration time-from-start" title="time elapsed since profiling started"> 149 <span class="profiler-unit">+</span>${MiniProfiler.formatDuration(timing.StartMilliseconds)} 150 </td> 151 152 {{if timing.HasSqlTimings}} 153 <td class="profiler-duration {{if timing.HasDuplicateSqlTimings}}profiler-warning{{/if}}" title="{{if timing.HasDuplicateSqlTimings}}duplicate queries detected - {{/if}}{{if timing.ExecutedReaders > 0 || timing.ExecutedScalars > 0 || timing.ExecutedNonQueries > 0}}${timing.ExecutedReaders} reader, ${timing.ExecutedScalars} scalar, ${timing.ExecutedNonQueries} non-query statements executed{{/if}}"> 154 <a class="profiler-queries-show"> 155 {{if timing.HasDuplicateSqlTimings}}<span class="profiler-nuclear">!</span>{{/if}} 156 ${timing.SqlTimings.length} <span class="profiler-unit">sql</span> 157 </a> 158 </td> 159 <td class="profiler-duration" title="aggregate duration of all queries in this step (excludes children)"> 160 ${MiniProfiler.formatDuration(timing.SqlTimingsDurationMilliseconds)} 161 </td> 162 {{/if}} 163 164 {{each page.CustomTimingNames}} 165 {{if timing.CustomTimings && timing.CustomTimings[$value]}} 166 <td class="profiler-duration" title="aggregate number of all ${$value.toLowerCase()} invocations in this step (excludes children)"> 167 ${timing.CustomTimings[$value].length} ${$value.toLowerCase()} 168 </td> 169 <td class="profiler-duration" title="aggregate duration of all ${$value.toLowerCase()} invocations in this step (excludes children)"> 170 ${MiniProfiler.formatDuration(timing.CustomTimingStats[$value].Duration)} 171 </td> 172 {{else}} 173 <td colspan="2"></td> 174 {{/if}} 175 {{/each}} 176 177 </tr> 178 179 {{if timing.HasChildren}} 180 {{each timing.Children}} 181 {{tmpl({timing: $value, page: page}) "#timingTemplate"}} 182 {{/each}} 183 {{/if}} 184 185</script> 186 187<script id="sqlTimingTemplate" type="text/x-jquery-tmpl"> 188 189 <tr class="{{if i % 2 == 1}}profiler-odd{{/if}}" data-timing-id="${s.ParentTimingId}"> 190 <td class="profiler-info"> 191 <div>${s.ParentTimingName}</div> 192 <div class="profiler-number"><span class="profiler-unit">T+</span>${MiniProfiler.formatDuration(s.StartMilliseconds)} <span class="profiler-unit">ms</span></div> 193 <div> 194 {{if s.IsDuplicate}}<span class="profiler-warning">DUPLICATE</span>{{/if}} 195 ${MiniProfiler.renderExecuteType(s.ExecuteType)} 196 </div> 197 <div title="{{if s.ExecuteType == 3}}first result fetched: ${s.FirstFetchDurationMilliseconds}ms{{/if}}">${MiniProfiler.formatDuration(s.DurationMilliseconds)} <span class="profiler-unit">ms</span></div> 198 </td> 199 <td> 200 <div class="query"> 201 <pre class="profiler-stack-trace">${s.StackTraceSnippet}</pre> 202 <pre class="prettyprint lang-sql"><code>${s.FormattedCommandString} </code></pre> 203 </div> 204 </td> 205 </tr> 206 207</script> 208 209<script id="sqlGapTemplate" type="text/x-jquery-tmpl"> 210 211 <tr class="profiler-gap-info{{if g.duration < 4}} profiler-trivial-gaps{{/if}}"> 212 <td class="profiler-info"> 213 ${g.duration} <span class="profiler-unit">ms</span> 214 </td> 215 <td class="query"> 216 <div>${g.topReason.name} — ${g.topReason.duration.toFixed(2)} <span class="profiler-unit">ms</span></div> 217 </td> 218 </tr> 219 220</script> 221