> I got it to work using <CFSET pmData = GetMetricData("perf_MONITOR") >
> 
> Now I wonder. It's not showing any data and I was wondering 
> a couple of things.
> 1.Does the server have to be running perfmon?
> 2.Can I tell this to get stats for a specific counter?
> 
> I'm looking to get statistics for a specific process on my 
> server, but I can't tell what's what.

You don't have to be running Performance Monitor - that's just an interface
for reading performance counters. You do have to have the "Enable
Performance Monitoring" option checked in the Debugging section of CF
Administrator. Also, since you mentioned that you're using Win2K, you may
need to install CF 4.5.1 SP2.

Once you've got it working, GetMetricData will return a structure with
twelve keys. Those keys will be the eleven performance counters exposed by
CF, plus the name of the instance being viewed. GetMetricData won't allow
you to get any performance counters other than those exposed by CF. This
code:

<cfset stPerf = GetMetricData("PERF_MONITOR")>

<cfloop collection="#stPerf#" item="counter">
        <cfoutput>#counter#: #stPerf[counter]#</cfoutput><br>
</cfloop>

will output something like this:

AVGDBTIME: 0
AVGQUEUETIME: 0
AVGREQTIME: 10
BYTESIN: 3106
BYTESOUT: 212
CACHEPOPS: 0
DBHITS: 0
INSTANCENAME: cfserver
PAGEHITS: 2
REQQUEUED: 0
REQRUNNING: 1
REQTIMEDOUT: 0

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to