Sys::CpuLoadX - a module to retrieve system load averages.


Forks-Super documentation  | view source Contained in the Forks-Super distribution.

Index


NAME

Top

Sys::CpuLoadX - a module to retrieve system load averages.

SYNOPSIS

Top

    use Sys::CpuLoadX;
    print '1 min, 5 min, 15 min load average: ',
         join(',', Sys::CpuLoadX::load()), "\n";
    print "Best estimate of current load = ", Sys::CpuLoadX::get_cpu_load(), "\n";

FUNCTIONS

Top

@loads = Sys::CpuLoadX::load()

Retrieves the 1 minute, 5 minute, and 15 minute load average of a machine.

$load = Sys::CpuLoadX::get_cpu_load()

Returns the best estimate of the current system load. For Unix like systems, this is the 1 minute load average like the one returned from uptime(1), and measures the average number of active processes that are competing for CPU time. For Windows machines (include Cygwin), it is computed from a one second sample of the CPU load, and is a value between 0 and 1 representing the fraction of CPU utilization during that second.

This function will return -1 if it cannot determine a suitable method for finding the CPU load on the system.

AUTHOR

Top

Original Sys::CpuLoad module by Clinton Wong, < http://search.cpan.org/search?mode=author&query=CLINTDW >

Original Win32::SystemInfo::CpuUsage by Jing Kang, < kxj@hotmail.com >.

Updates by Marty O'Brien, < mob@cpan.org >.

LICENSE AND COPYRIGHT

Top


Forks-Super documentation  | view source Contained in the Forks-Super distribution.