Sam Farmer

Growing up I never imagined I would play bass guitar for the Dave Matthews Band. And indeed it never happened.

10 Little Ones: Memory and CPU Figures (#1)

February 29, 2012
ColdFusion 10 beta adds three new functions that provide system stats: The first returns a percentage while the other two return the amount of bytes. Here is a quick example:

CPU Usage #getCPUUsage()#

System Memory
Total #getSystemTotalMemory()#
Free #getSystemFreeMemory()#
% Free: #numberFormat( ( getSystemFreeMemory()/getSystemTotalMemory() ) *100, "999.99")#

Which produces

CPU Usage 24.875624

System Memory
Total 8589934592
Free 1640640512
% Free: 19.10
Pretty straightforward and information that would look good in the new charting functionality...

(This is the first in a series to show off some of the smaller additions to ColdFusion 10).


Your link "charting functionality" is broken.

By: Raymond Camden 03/01/2012 7:58 AM
Thanks for the heads up. Fixed.

By: Sam Farmer 03/01/2012 9:03 AM
Some comments have been lost over the years due to moving hosts.


More blog entries that I have written.

Code coloring by PRISM.