Skip to content

Commit 250e9a4

Browse files
committed
Add a total execution time for all queries
1 parent e9e660a commit 250e9a4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

includes/panels/qbPanel.cfm

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Description :
1515
var isQuickInstalled = getController().getModuleService().isModuleRegistered( "quick" );
1616
var isQBInstalled = getController().getModuleService().isModuleRegistered( "qb" );
1717
var totalQueries = request.cbdebugger.keyExists( "qbQueries" ) ? request.cbdebugger.qbQueries.all.len() : 0;
18+
var totalExecutionTime = !request.cbdebugger.keyExists( "qbQueries" ) ? 0 : request.cbdebugger.qbQueries.all.reduce( function( total, q ) {
19+
return total + q.executionTime;
20+
}, 0 );
1821
var totalEntities = request.cbdebugger.keyExists( "quick" ) ? request.cbdebugger.quick.total : 0;
1922
</cfscript>
2023
<cfoutput>
@@ -101,10 +104,19 @@ Description :
101104
</tbody>
102105
</table>
103106
</div>
107+
<div style="margin-top: 0.5em; margin-left: 1em;">
108+
<div class="fw_debugTitleCell">
109+
Total Execution Time:
110+
</div>
111+
<div class="fw_debugContentCell">
112+
#totalExecutionTime# ms
113+
</div>
114+
</div>
104115
</cfif>
105116
</cfif>
106117
</div>
107118
<cfif isQuickInstalled>
119+
<hr />
108120
<div id="quickEntities" style="margin-top: 1em;">
109121
<div class="fw_subtitles">&nbsp;Entities <span class="fw_badge_dark" style="margin-left: 1em;">#totalEntities#</span></div>
110122
<cfif totalEntities EQ 0>
@@ -120,7 +132,7 @@ Description :
120132
<tbody>
121133
<cfloop collection="#request.cbdebugger.quick.byMapping#" item="mapping">
122134
<tr <cfif debugTimers.currentrow mod 2 eq 0>class="even"</cfif>>
123-
<td>#request.cbdebugger.quick.byMapping[ mapping ]#</td>
135+
<td align="center">#request.cbdebugger.quick.byMapping[ mapping ]#</td>
124136
<td>#mapping#</td>
125137
</tr>
126138
</cfloop>

0 commit comments

Comments
 (0)