Skip to content

Instantly share code, notes, and snippets.

@robjshaw
Created March 13, 2013 04:57
Show Gist options
  • Select an option

  • Save robjshaw/5149483 to your computer and use it in GitHub Desktop.

Select an option

Save robjshaw/5149483 to your computer and use it in GitHub Desktop.
cfquery monitoring on a batch without debugging enabled
<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