Created
March 13, 2013 04:57
-
-
Save robjshaw/5149483 to your computer and use it in GitHub Desktop.
cfquery monitoring on a batch without debugging enabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| stQuery = structNew(); | |
| </cfscript> | |
| <cfquery name="stQuery.a" datasource="#request.ds#"> | |
| SELECT * | |
| FROM table1 | |
| </cfquery> | |
| <cfquery name="stQuery.b" datasource="#request.ds#"> | |
| SELECT * | |
| FROM table2 | |
| </cfquery> | |
| <cfquery name="stQuery.c" datasource="#request.ds#"> | |
| SELECT * | |
| FROM table3 | |
| </cfquery> | |
| <cfloop collection="#stQuery#" item="q"> | |
| <cfoutput><li>#q# [count:#stQuery[q].recordcount#] #numberFormat(max(stQuery[q].getMetaData().getExtendedMetaData().executionTime, 1)/1000, "0.000")#</li></cfoutput> | |
| </cfloop> | |
| will output:- | |
| a [count:0] 0.001 | |
| b [count:1] 0.001 | |
| c [count:1] 0.001 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment