CFC Debugging

ColdFusion has numerous debugging options. One of them includes a template execution report. This table includes every CFML template run as well as the total time spent on it, along with an average. Along with CFML templates, it also includes CFC method calls. One problem with this report, though, is that it considers CFC method calls with different arguments as different things to report. That's not bad at all. It may be that foo(1) is significantly slower than foo(0). However, I was looking for a report that gathered all the CFC calls together and gave more of a summary type report.

Luckily, ColdFusion's debugging templates are all unencrypted CFML templates. That means you can modify or add your own debugging templates. I copied the basic report (classic.cfm), and began working. The debugging data is a bit difficult to work with. For example, CFC calls don't have their own API in the debugging code. I plugged away a bit and was able to strip the data down to just the CFC and the method. I then added the report you see below:

To play with this, simply download the file here. Unzip, and copy to your cfusionmx7\wwwroot\web-inf\debug folder. Then go to your CF Admin, select classic2.cfm as your template, and then hit a page with any CFC call in it. I plan on modifying it a bit later to show both a min and max report on each CFC method.

Comments

Ray,

Noticed the util cfc that you have in your blog directory (which isn't part of your normal distribution), what are you using for the colored code function. I've been using colorizer code from the old cfcomet.com site (its been down for awhile, maybe it will come back someday). Always looking for new code colorizer options.
# Posted By Christopher Wigginton | 10/4/05 9:23 PM
Actually it is the same code, cleaned up a bit by a user (I forget who, his name is in the code though).
# Posted By Raymond Camden | 10/4/05 10:02 PM
Thanks Ray,

I'm using your mod... and lovin it!!!
# Posted By Steini Jonsson | 10/5/05 4:48 AM
Thanks for another great tool. :)
# Posted By Dave Shuck | 10/5/05 7:24 AM
Hey Ray, great job, highly useful, is there any way you know of to get the parameters that were passed in the the arguments?
# Posted By Nik | 10/5/05 10:02 AM
Actually, the original data has that. I had to strip it out to 'summarize' the calls. If you wanted to rebreak it out, you could. You could then build a table that has the same details as the _default_ template, but ONLY shows CFCs. Make sense?
# Posted By Raymond Camden | 10/5/05 10:04 AM
I've been googling for debugging for ColdFusion and, as well as this page, I found a couple of other tools. So far my favourite is FusionReactor (fusion-reactor.com) but I was wondering if anyone else had tried it and could let me know what they thought?
# Posted By Duckling | 12/2/05 3:48 AM
It's quite off topic, but I was hoping to find a copy of that cf-code colorizer.

Any ideas?
# Posted By Sam | 8/17/06 4:06 PM
You mean the one in my blog? It's in the download.
# Posted By Raymond Camden | 8/17/06 4:08 PM
Hi

I am unable to download the zip file which contains classic2.cfm.
# Posted By abhishek shrivastava | 11/13/07 1:09 AM
# Posted By Raymond Camden | 11/13/07 6:14 AM