The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Linux::Info::LoadAVG - Collect linux load average statistics.

VERSION

version 2.16

SYNOPSIS

    use Linux::Info::LoadAVG;

    my $lxs  = Linux::Info::LoadAVG->new;
    my $stat = $lxs->get;

DESCRIPTION

Linux::Info::LoadAVG gathers the load average from the virtual /proc filesystem (procfs).

For more information read the documentation of the front-end module Linux::Info.

LOAD AVERAGE STATISTICS

Generated by /proc/loadavg.

    avg_1   -  The average processor workload of the last minute.
    avg_5   -  The average processor workload of the last five minutes.
    avg_15  -  The average processor workload of the last fifteen minutes.

METHODS

new()

Call new() to create a new object.

    my $lxs = Linux::Info::LoadAVG->new;

It's possible to set the path to the proc filesystem.

     Linux::Info::LoadAVG->new(
        files => {
            # This is the default
            path    => '/proc',
            loadavg => 'loadavg',
        }
    );

get()

Call get() to get the statistics. get() returns the statistics as a hash reference.

    my $stat = $lxs->get;

EXPORTS

Nothing.

SEE ALSO

AUTHOR

Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Alceu Rodrigues de Freitas Junior.

This is free software, licensed under:

  The GNU General Public License, Version 3, June 2007