[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monit] Problem in calculating total cpu and memory percentage

From: Martin Pala
Subject: Re: [monit] Problem in calculating total cpu and memory percentage
Date: Wed, 11 Nov 2009 11:05:18 +0100


the cpu percent is kept internally as shifted integer, hence * 1000.

There was problem with counting total memory and cpu percentage on some 
platforms - particularly FreeBSD jails, Linux Virtual Server, VPS, OpenVZ, etc. 
since these restricted environments doesn't show whole process tree. This is 
fixed in source repository now (needs more testing yet) and next Monit version 
will work fine even in these environments.

Another requirement on most platforms when Monit should be able to detect cpu 
and memory usage was that it had to run as root. This requirement is also 
removed in next version.


On Nov 11, 2009, at 8:11 AM, Neelam Baliyan wrote:

> Hi,
> Actually i am try to find total memory and cpu percentage.
> memory Percentage:-
> in file process.c you used the formula given below :-
> systeminfo.total_mem_percent= (int)(1000 *
> (double)systeminfo.total_mem_kbyte / (double)systeminfo.mem_kbyte_max;
> Why you multiple it by 1000 ?
> CPU percentage :-
> 1. why cpu percentage is dependent on the previous values ?
> in file process/sysdep_LINUX.c you used the formula given below :-
> si->total_cpu_user_percent =(int)(1000 * (double)(cpu_user - old_cpu_user) /
> delta);
> why the value is multiply by 1000 here also ?
> I m try to find out the total percentage of memory and cpu usgae.
> Thanks
> Neelam
> -- 
> View this message in context: 
> Sent from the monit-general mailing list archive at
> --
> To unsubscribe:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]