root/coldbox/trunk/src/system/includes/debug.cfm @ 627

Revision 627, 8.4 kB (checked in by lmajano, 6 years ago)

Ticket #137
Request Collection Snapshot.

Line 
1<cfsetting enablecfoutputonly=true>
2<!-----------------------------------------------------------------------
3********************************************************************************
4Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
5www.coldboxframework.com | www.luismajano.com | www.ortussolutions.com
6********************************************************************************
7
8Template :  debug.cfm
9Author   :      Luis Majano
10Date     :      September 25, 2005
11Description :
12        Debugging template for the application
13
14Modification History:
1510/13/2005 - Moved reqCollection from session to request.
1612/23/2005 - Eliminated ConfigStruct Dump
1701/06/2006 - Eliminated controller references.
1801/16/2006 - Added support for child applications.
1906/08/2006 - Updated for coldbox.
2006/09/2006 - Changed isDefined to StructkeyExists
2107/12/2006 - Tracer now shows first expanded.
2202/01/2007 - Updated context references
23----------------------------------------------------------------------->
24<cfoutput>
25<cfinclude template="debugHeader.cfm">
26<br><br><br>
27<div class="fw_debugPanel">
28
29<!--- **************************************************************--->
30<!--- TRACER STACK--->
31<!--- **************************************************************--->
32        <cfif structkeyExists(RequestCollection, "tracerStack")>
33        <cfoutput>
34                <!--- <cfinclude template="style.cfm"> --->
35                <div class="fw_titles" onClick="fw_toggle('fw_tracer')">&gt;&nbsp;Tracer Messages </div>
36                <div id="fw_tracer" class="fw_info">
37                <cfloop from="1" to="#arrayLen(RequestCollection.tracerStack)#" index="i">
38                <div class="fw_tracerMessage">
39                <strong>Message:</strong><br>
40                #RequestCollection.tracerStack[i].message#<br>
41                <strong>ExtraInformation:<br></strong>
42                <cfif not isSimpleValue(RequestCollection.tracerStack[i].extrainfo)>
43                        <cfdump var="#RequestCollection.tracerStack[i].extrainfo#">
44                <cfelseif RequestCollection.tracerStack[i].extrainfo neq "">
45                        #RequestCollection.tracerStack[i].extrainfo#
46                <cfelse>
47                        {Not Sent}
48                </cfif>
49                </div>
50                </cfloop>
51                </div>
52        </cfoutput>
53        </cfif>
54<!--- **************************************************************--->
55
56
57<!--- **************************************************************--->
58<!--- DEBUGGING PANEL --->
59<!--- **************************************************************--->
60        <div class="fw_titles" onClick="fw_toggle('fw_info')" >
61                &gt; &nbsp;ColdBox Debugging Information
62        </div>
63
64        <div class="fw_debugContentView" id="fw_info">
65                <div class="fw_debugTitleCell">
66                  Framework Info:
67                </div>
68                <div class="fw_debugContentCell">
69                #controller.getSetting("Codename",true)# #controller.getSetting("Version",true)# #controller.getSetting("Suffix",true)#
70                </div>
71                <div class="fw_debugTitleCell">
72                  Application Name:
73                </div>
74                <div class="fw_debugContentCell">
75                #controller.getSetting("AppName")#
76                </div>
77
78                <div class="fw_debugTitleCell">
79                  JVM Memory
80                </div>
81                <div class="fw_debugContentCell">
82                #NumberFormat(JVMFreeMemory)# KB / #NumberFormat(JVMTotalMemory)#       KB (Free/Total)
83                </div>
84
85                <div class="fw_debugTitleCell">
86                  TimeStamp:
87                </div>
88                <div class="fw_debugContentCell">
89                #dateformat(now(), "MMM-DD-YYYY")# #timeFormat(now(), "hh:MM:SS tt")#
90                </div>
91
92                <div class="fw_debugTitleCell">
93                  Browser:
94                </div>
95                <div class="fw_debugContentCell">
96                #cgi.HTTP_USER_AGENT#
97                </div>
98
99                <div class="fw_debugTitleCell">
100                  Query String:
101                </div>
102                <div class="fw_debugContentCell">
103                <cfif cgi.QUERY_STRING eq ""><span class="fw_redText">N/A</span></cfif>#cgi.QUERY_STRING#
104                </div>
105
106                <div class="fw_debugTitleCell">
107                  Remote IP:
108                </div>
109                <div class="fw_debugContentCell">
110                #cgi.REMOTE_ADDR#
111                </div>
112
113                <div class="fw_debugTitleCell">
114                  Server Instance:
115                </div>
116                <div class="fw_debugContentCell">
117            #controller.getPlugin("fileUtilities").getInetHost()#
118                </div>
119
120                <div class="fw_debugTitleCell">
121                  Current Event:
122                </div>
123                <div class="fw_debugContentCell">
124                <cfif Event.getValue("event","") eq ""><span class="fw_redText">N/A</span><cfelse>#Event.getValue("event")#</cfif>
125                </div>
126
127                <div class="fw_debugTitleCell">
128                  Current Layout:
129                </div>
130                <div class="fw_debugContentCell">
131                <cfif Event.getValue("currentlayout","") eq ""><span class="fw_redText">N/A</span><cfelse>#Event.getValue("currentlayout")#</cfif>
132                </div>
133
134                <div class="fw_debugTitleCell">
135                  Current View:
136                </div>
137                <div class="fw_debugContentCell">
138                <cfif Event.getValue("currentview","") eq ""><span class="fw_redText">N/A</span><cfelse>#Event.getValue("currentview")#</cfif>
139                </div>
140
141                <!--- **************************************************************--->
142                <!--- Method Executions --->
143                <!--- **************************************************************--->
144                <em><p>Method execution times in execution order.</p></em>
145                <table border="0" align="center" cellpadding="0" cellspacing="1" class="fw_debugTables">
146                  <tr >
147                        <td width="13%" align="center" class="fw_debugTablesTitles">Timestamp</td>
148                        <td width="10%" align="center" class="fw_debugTablesTitles">Execution Time</td>
149                        <td class="fw_debugTablesTitles">Framework Method</td>
150                        <td width="75" align="center" class="fw_debugTablesTitles" >RC Snapshot</td>
151                  </tr>
152                  <cfloop query="request.DebugTimers">
153                  <cfif findnocase("render", method)>
154                        <cfset color = "fw_redText">
155                  <cfelseif findnocase("pre",method) or findnocase("post",method)>
156                        <cfset color = "fw_purpleText">
157                  <cfelseif findnocase("runEvent", method)>
158                        <cfset color = "fw_blueText">
159                  <cfelse>
160                        <cfset color = "fw_greenText">
161                  </cfif>
162                  <tr >
163                        <td align="center" class="fw_debugTablesCells">#TimeFormat(timestamp,"hh:MM:SS.l tt")#</td>
164                        <td align="center" class="fw_debugTablesCells">#Time# ms</td>
165                        <td class="fw_debugTablesCells"><span class="#color#">#Method#</span></td>
166                        <td align="center" class="fw_debugTablesCells">
167                                <cfif rc neq ''><a href="javascript:fw_poprc('fw_poprc_#id#')">View</a><cfelse>...</cfif>
168                        </td>
169                  </tr>
170                  <tr id="fw_poprc_#id#" style="display:none">
171                        <td colspan="4" style="padding:5px;background-color:##fffff0" >#rc#</td>
172                  </tr>
173                  </cfloop>
174                  <tr>
175                        <td colspan="4" class="fw_debugTablesTitles">Total Framework Request Execution Time: #request.fwExecTime# ms</td>
176                  </tr>
177                </table>
178                <!--- **************************************************************--->
179        </div>
180
181
182<!--- **************************************************************--->
183<!--- Cache Performance --->
184<!--- **************************************************************--->
185
186        <cfinclude template="cachepanel.cfm">
187
188<!--- **************************************************************--->
189<!--- DUMP VAR --->
190<!--- **************************************************************--->
191        <cfif controller.getSetting("EnableDumpVar")>
192                <cfset dumpList = Event.getValue("dumpvar",0)>
193                <cfif dumplist neq 0>
194                <!--- Dump Var --->
195                <div class="fw_titles" onClick="fw_toggle('fw_dumpvar')">&gt;&nbsp;Dumpvar </div>
196                <div class="fw_debugContent" id="fw_dumpvar">
197                        <cfloop list="#dumplist#" index="i">
198                                <cfif isDefined("#i#")>
199                                        <cfdump var="#evaluate(i)#" label="#i#">
200                                </cfif>
201                        </cfloop>
202                </div>
203                </cfif>
204        </cfif>
205<!--- **************************************************************--->
206
207
208<!--- **************************************************************--->
209<!--- Request Collection Debug --->
210<!--- **************************************************************--->
211        <div class="fw_titles"  onClick="fw_toggle('fw_reqCollection')" >
212        &gt; &nbsp;Request Collection Structure
213        </div>
214        <div class="fw_debugContent" id="fw_reqCollection">
215                <table border="0" cellpadding="0" cellspacing="1" class="fw_debugTables" width="100%">
216                  <cfloop collection="#RequestCollection#" item="vars">
217                  <tr>
218                        <td align="right" width="15%" class="fw_debugTablesTitles">#lcase(vars)#:</td>
219                        <td  class="fw_debugTablesCells">
220                        <cfif isSimpleValue(Event.getValue(vars)) >
221                                <cfif Event.getValue(vars) eq ""><span class="fw_redText">N/A</span></cfif> #Event.getValue(vars)#
222                        <cfelse>
223                                <cfdump var="#Event.getValue(vars)#">
224                        </cfif>
225                        </td>
226                  </tr>
227                  </cfloop>
228                </table>
229        </div>
230<!--- **************************************************************--->
231
232        <br />
233        <em><strong>Approximate Debug Rendering Time: #GetTickCount()-DebugStartTime# ms</strong></em>
234        <br /><br />
235
236</div>
237</cfoutput>
238<cfsetting enablecfoutputonly=false>
Note: See TracBrowser for help on using the browser.