So a few days ago I blogged about my new project, Starfish. Starfish is essentially a ColdFusion debugger that doesn't display information, but rather stores it in the Server scope. You can then display a report on this data in the CF Admin. I'm now happy to report that the initial version is ready for download.
Some BIG WARNINGS - This code is ugly. I'm not kidding. I know that some people have told me they have learned a lot from downloading my code and looking at it. Don't do that. Avoid the code like the plague. Ok, so it's not that bad, but it was written very quickly. I'd call this version more a Proof of Concept than a real application.
That being said - I'd love feedback on it. I've set up a forum for the project, so please use it for your ideas. Also, I've finally gotten around to creating a "Projects" site. You can see the Starfish project here:
http://www.coldfusionjedi.com/projects/starfish
All of my projects will have a page like this - as I get around to it. As always, if you like this, visit my wishlist. (I'm still waiting for someone to pick up the Nano - what's wrong you people - too cheap?!?! ;)
Edited: Oops - so I forgot to mention. The zip has NO instructions. Here are some simple instructions for now:
Unpack the zip. profiler.cfm goes in cfusionmx7\wwwroot\web-inf\debug In your cf admin, turn on debugging and select the template. Take the other files and place them in:
webroot\CFIDE\administrator\profiler
Add this line to extensionscustom.cfm in your cf admin folder:
<a href="profiler/index.cfm" target="content">Profiler</a><br>
Archived Comments
while this is probably obvious you might want to mention this is for CFMX 7+ and not for CFMX6 before you get people asking why it isn't working with 6..
Ray, your product names are starting to confuse me ;-) I like it much better when you include what the app does as part of the name - like BlogCFC, Galleon Forums, scopeChache, etc. Simple names like Starfish, Soundings, etc. make it harder to remember what each app does, especially at a glance.
Of course, you notice that I never have any complaints about your code, so that's saying something!
I'm trying to be good about using "full" names, but I forgot to do it for the category name. Thanks!
Bill: True. Although the reporting could be changed to work in CFMX.
Is it just me or can't others find the extensionscustom.cfm like I do... Call me stupid, but I have no idea which file it might be to add the line: <a href="profiler/index.cfm" target="content">Profiler</a><br>
:-)
I had the same problem. Just create the file yourself and paste the link in it.
Sorry about that guys. I do promise "real" documentation later.
WOW! Cool, got it to work!
This is a helpfull little widget in the admin! Now I have an idea how the admin is setup as well :-) Good stuff to know how to modify it...
Thanks!
"In your cf admin, turn on debugging and select the template." There's no place to select a template under Debugging & Logging > Debugging Settings. There is a place under the main menu,
Custom Extensions-> Profiler, which I'm assuming from the previously provided screen shot is what this is referring to.
It says "Sorry, but there is no profiling data at this time."
Jim, go to Debugging Settings, and look at Select Debugging Output Format. You should see profile.cfm in there. If you do not, ensure you copied the file per my (bad) instructions above.
Um, Debugging Settings...Select Debugging Output Format..classic.cfm and dockable.cfm are my choices. Im using CF Version 7,0,0,91690 in developer mode using Jrun. My update level is... /C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/updates/chf700002.jar
I created extensionscustom.cfm in...AH HA!I failed to RTFI closely and put it in C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\CFIDE\administrator\debugging instead of
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\debug . Let's try it now...
OK now at least I get an error..
"Attribute validation error for tag CFFORMITEM.
The value of the attribute TYPE, which is currently "script", must be one of the values: HRULE,HTML,TEXT,VRULE,SPACER."
Oh well SimonH AND Jared are around here somewhere, maybe one of them can apply their vast intellect to fixing it...
"Attribute validation error for tag CFFORMITEM.
The value of the attribute TYPE, which is currently "script", must be one of the values: HRULE,HTML,TEXT,VRULE,SPACER."
Oh well SimonH AND Jared are around here somewhere, maybe one of them can apply their vast intellect to fixing it...
You need to have the 7.0.1 updater installed
Jim, Sean covered part two for you. It sounds like you did not copy profiler.cfm to cfuisnmx7/wwwroot\web-inf\debug. Once you do, it will show up in the drop down.
Can't do 7.0.1, because the client is still on 7. Oh well. Thanx anyway. Yes Ray, I said in my post the profiler.cfm was showing up, thats when I got the error. Thanks again.
It wouldn't take much work to mod it to work in CF 7. You could also try it on your own dev machine. I'm looking for any kind of feedback.
Jared and Nick say it involves a cfsavecontent. My dev machine has to match the clients environment. Will give it a shot.
Arrrg. Jared says "<cfgrid name="templates" ...onChange="loadGraph()" makes it 7.01 only. Oh well we may be upgrading soon.
Heh, sorry for all the trouble then. :) Hey, in my opinion this one app alone with worth the upgrade! ;)
I'd love to upgrade but I'd love the underlying app to work on the client's system more :)
Any reason why you are worried about upgrading? Or just need time to plan it?
Well it's the clients call and there is always a risk and a cost associated with an upgrade. You can't just upgrade willy-nilly without testing etc. if you want to be employed.
And as long as the client is on 7.0 I have to be on 7.0 also, not 7.x. I don't want to deploy the app into production and have it break.
Makes perfect sense - was just wondering if there was some known issue the client was worried about.
I got the link added to the administrator.. For those who can't get that to go... here are the instructions.
Add a file called extensionscustom.cfm under CFIDE\administrator\
Add the following code in the file:
<a href="profiler/index.cfm" target="content">Profiler</a><br>
Restart the CF Server and you should see a Menu Item called "Custom Extensions" and Profiler is a link under that.
Now.. I have a question... Once I got that to work I click on the Profiler link and this is what I see on my Content side.
"Sorry, but there is no profiling data at this time." Ray Please help me....
Thanks
Go to the debugging settings in your cf admin and pick profiler as your debugging template. ensure that debugging is turned on. then hit an application, any app, on your box. Then return to the reports.
Thanks Ray. I did not run an application.. that was the problem...
Guys,
Needed some help. Ran through the directions and comments. We have 7.01.
Steps:
1. Copied profiler.cfm to cfusionmx7\wwwroot\web-inf\debug. It shows up in the debug template list.
2. Went to CFIDE\administrator, no profiler directory, created one. Placed the rest of the zip files in here.
3. Went to CFIDE\administrator, added extensionscustom.cfm with the necessary text. Saw a comment to try, CFIDE\administrator\debugging. Did the same here.
Still no go. I dont see the extra menu item created in CFAdmin. What did I do wrong?
-Sami
Someone mentioned having to restart CF, but I don't remember doing that. If worse comes to worse, just go to /cfide/adminsitrator/profiler.
Ray,
Dont see the menu item in CFAdmin, but I did go to http://xyz/cfide/administrator/profiler, and it came up.
Hopefully we'll get some step by step instructions. Looks very useful though!
-Sami
Very cool looking!
Question / suggestion: It looks like this is only capturing debug information for requests served to IP's listed in the debug IP list, correct? Is this possible to enable for all IP addresses?
I only ask because this would be a great profiler for a server. Let it run for 20 minutes, and see what apps are being hit the hardest, find performance bottlenecks, etc. Very awesome code, thanks for all your effort!
- Justice
I did not have to restart CF, just logout and login again and the new menu should be at the bottom.
Justice - I'm not sure actually. My code doesn't even bother to check for debugmode, so it MAY always run. Test it and let me know. ;)
Well, from the 20 minutes spent on my production server with about 75 active users, it looks like it currently does not work for anything other than official 'debut IP's' that are setup in the CF Admin. =)
I wonder if there is a way to add a wild card temporarily to the admin debug IP list so I can gather data for my entire server?
nevermind, answered my own dumb question =) Remove all IP's from debugger list, and all will report in data. Thanks again for the awesome tool Ray!
Another suggestion: (can you tell I have been playing with / beating on this a bit today?)
In the Query view tab, show me some way to see what template the query was called from, and possibly the same thing in the .cfc's tab?
Dont get me wrong, not expecting any response or code change's, I am just trying to provide (hopefully) constructive feedback and idea's!
No, this is exactly what I want, so keep it coming. There is only one problem. I store SQL by unique DSN, query name, and SQL. It is possible that N documents will contain it. Ditto for CFC calls, which are unique by CFC name, method, and args. So while I need to check if it is possible, I'm not sure of the UI of it.
Just checked - for CFCs the template that called it is in the debug info. For a query, the template is also recorded. So what I'd probably do is store an array of templates that executed the code. I'll probably make it so a click on the record loads it in some detail pane or something.
Be great if the graph could give a bit more info about what it's showing, template name etc. Too easy for long names to get hidden in the grid.
Very groovy tool though, it will help me find bottle necks much faster.
Thanks Ray
Nice starter work. Here are some of the things to add to it.
1. In the profiler... a refresh button. (I am sure there are those who don't know to click on the sidebar to get an update.)
2. If it were possible to collect application specific... or narrow down to just items in a directory and subdirectories that would be great!)
3. Profiling a time period option.
4. The time for min time and max time should be on same numeric scale.
5. The ability to store the details in a database for data minning!
6. Knowing where a query was called from would be great.
7. there is a danger in caching the queries... like for a user login the password can be stored. Or in a financial transaction a credit card number could be stored... so this would be a security issue to think through very carefully. Perhaps you should have an option to turn on query caching rather than storing the SQL by default. That would reduce the danger to some degree.
8. Query number of records would be nice also.
9. The ability to trim off the "web root" directories would be nice... it's hard to read long directory names.
10. Ability to clear the store. (Reset or whatever)
Hahahaha, I dumped the server scope and see a structure called '____RAY'S SECRET CACHE. SHHHHH. DON'T LOOK IN HERE.' Thats great!! lol
=)
Just a note to Jim Collins (and others who may not have thought of it):
You can always create new JRun server instances and run different versions of CFMX on each.
This allows you to check your code on 7.0 and 7.0.1 side-by-side (and of course now CHF1 for 7.0.1).
Hey now, you weren't supposed to tell anyone about the secret cache. ;)
I must have something wrong because in the debugging area at the bottom of each page I keep getting this error:
500 Element VALUE is undefined in a CFML structure referenced as part of an expression.
Element VALUE is undefined in a CFML structure referenced as part of an expression.
Running CF 7.01
I did a dump on #attr# right before the loop that calls for VALUE (on line 36 in profiler.cfm) and the struct only has sqlType, Type, and variable.
This is from this stored proc call
<cfstoredproc procedure="getDateTime" datasource="#dsn#">
<cfprocparam type="Out" cfsqltype="CF_SQL_TIMESTAMP" variable="currentDateTime" null="No">
</cfstoredproc>
Thoughts?
Thanks Jay - looks like a real bug. I didn't do any actual testing w/ SPs. I'll try to release a fix sometime soon, but work is hellish lately.
Hi.
I've ColdFusion MX 7,0,1,116466 installed on IIS 5 with w2k server, but don't show chart (it's empty!).
Why?
When Flash Forms don't show up, the first thing you look for is a bad, or missing, CFIDE mapping.
Can we get StarFish in Riaforge?
I could - but I didn't think people actually used it anymore?
I'd like to give it a try. In our dev/stage environment, it could provide some valuable info. :D
Heh, did you miss the Projects tab on top? :)
http://ray.camdenfamily.com...