I am rolling my own simple web-based perfmon, I am not happy with some of the data I can get like cpu usage, which i use via a sql query. I am able to get memory usage just fine...I will attach a screenshot, so you can see what I currently have for my main/home/dashboard page.
I am currently using webcharts3d, which i am loving being able to use ajax, update the chart, and i have a dynamically updating dashboard. Yes of course I have to get only a few performance counter's so in my desire to have a web-based performance dashboard i do not kill the server.
DECLARE @CPU_BUSY int, @IDLE int
SELECT @CPU_BUSY = @@CPU_BUSY, @IDLE = @@IDLE WAITFOR DELAY '000:00:01'
SELECT (@@CPU_BUSY - @CPU_BUSY)/((@@IDLE - @IDLE + @@CPU_BUSY - @CPU_BUSY) *1.00) *100 AS 'CPU'
And all i get in results is 0.0000, so either the query is wrong, or i have very little cpu activity going on. Where as when I use my windows task manager.
Here is the code for gathering memory I am using, I do not claim credit for any of this code, I found it somewhere.
<cfscript>
jRuntime = CreateObject("java","java.lang.Runtime").getRuntime();
memory = StructNew();
memory.freeAllocated = jRuntime.freeMemory() / 1024^2;
memory.allocated = jRuntime.totalMemory() / 1024^2;
memory.used = memory.allocated - memory.freeAllocated;
memory.percentUsedAllo = (memory.used / memory.allocated) * 100;
</cfscript>
So I am looking for more wmi or java or scripts to get cpu usage, and perhaps any other important server stat.
Thank You.