In article < >, Meir wrote:
> Is there a way in Java to find-out the current CPU load ?
>
> Are there any external packages for this ?
>
> All I need is a single number in percents,
> but I need a solution for Windows2K and UNIX.
>
> Meir
First you must get the system paramter to find out what system you're on.
For each type of system load the right module: the kernel32.dll for
windows and nothing for unix/linux. I'm sure there is a call you could
make with the kernel32.dll to find the windows load average. For unix
exec /usr/bin/uptime and read/parse its output. For Linux you can
open and read /proc/cpuinfo until you find the load average.
Mike
|