===================================================================== NetworkNewz - Server Monitor API In Coldfusion 8 June 25, 2007 http://www.networknewz.com ********************************************************************* ********************************************************************* Are you running Exchange email security tools from Symantec, McAfee, Trend, or MS-Antigen? Tired of their high (renewal) prices, hard to manage product, and/or lack of features? Upgrade to Ninja's next-generation email security, and spend half your admin time, and half your budget! Download Ninja Email Security - US/CANADA ONLY http://aj.600z.com/aj/29963/0/cc?z=1&b=29960&c=29961 ********************************************************************* ********************************************************************* Server Monitor API In Coldfusion 8 Raymond Camden | Expert Author In an earlier post I talked a bit about how the Admin API has been updated in ColdFusion 8. For folks who don't know what this is - it is a way to get into the internals of ColdFusion directly from CFML. It requires the ColdFusion Admin password, which may be a negative for some, but if you have access to it, you can do quite a bit. As an example, I could build an installer for BlogCFC that would prompt the user for the CF Admin password and then handle creating the datasource for you. So it's cool. We know that. But how cool is it in ColdFusion 8? Well you know that server monitor that ships with the product? If you haven't seen it, you need to spend some time with it. I spent 5 minutes running it with BlogCFC and saw immediate, serious performance issues I was able to correct. 5 minutes to improve my application in a dramatic way is worth the cost of ColdFusion 8 right there. But did you know that 100% of what you see in the Flex application is available to you via code? Added to the Admin API is a new CFC, the Server Monitoring CFC. This CFC gives you access to everything you see in the Flex app, and maybe a bit more. Now it is important to note that each method has different requirements for server monitoring. Some require that memory tracking is turned on. Some require nothing. Some return data but will return more data if memory tracking is on. You should read the docs carefully to see what each method requires. What follows is a short list of some of what is available... Get Active Session Count This lets you get the total number of active sessions for the server - or you can supply a ColdFusion Application name and get the number just for that application. Get Average Response Time This is a great metric. It tells you - on average - how quickly your templates are responding. ********************************************************************* ********************************************************************* Reach farther. Grow Faster. Start Meeting Online! Easily Meet Online with Zero Hassle and Zero Travel. Try WebEX MeetMeNow for FREE! http://aj.600z.com/aj/30508/0/cc?z=1&b=30506&c=30507 ********************************************************************* ********************************************************************* Get Heartbeat This returns a structure of general information. This includes a variety of items like server up time, average request time, current requests, etc. Get Memory Utilization Summary As you can guess - this returns information about your memory usage. It tells you how much data your Application, Server, and Session scope data is using. Get Hit Count Stats Now this one is truly cool. Along with telling you how many normal template hits you have - it can tell you the number of web service hits - the number of Flash Remoting hits - even the number of direct HTTP hits to your CFCs. Get Logged In User Count Returns the number of users logged in via CFLOGINUSER. Get All Application Scope Memory Used This returns all your applications and the amount of RAM they are using. Have a machine that is running a bit slow? Run this and it will tell you if one application in particular is being a bad boy. You can follow it up with getApplicationScopeMemoryUsed which returns specific data about one particular application. Cool stuff, eh? It is important to note that using these features will have an impact on your server performance. I had a demo online, but I could really tell the impact of the monitoring so I turned it off. But if you want to see the code I used (with a different Admin password of course, I trust some of you guys... ;), look here: Total session count =

For app lighthousepro =

Average response time is #result#

Logged in users =

********************************************************************* ********************************************************************* You need to make a conference call, and you need it now. Whether you are a Fortune 500 company or a small business just getting on your feet, you need to meet when and where it’s convenient for you. Set Up Your Account For Free And Start Conferencing Today! Try ConferenceCall.com Now! http://aj.600z.com/aj/29877/0/cc?z=1&b=29408&c=29876 ********************************************************************* ********************************************************************* About the Author: Raymond Camden, ray@camdenfamily.com http://ray.camdenfamily.com Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy. ********************************************************************* ********************************************************************* For ad details and prices... mailto:susan@ientry.com ********************************************************************* Signup for free newsletters: http://www.ientry.com/page/newsletters ********************************************************************* --- NetworkNewz is an iEntry.com publication --- http://www.iEntry.com iEntry, Inc. 2549 Richmond Rd Second Floor Lexington, KY 40509 *********************************************************************