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::FileStats - Collect linux file statistics.

VERSION

version 2.16

SYNOPSIS

    use Linux::Info::FileStats;

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

DESCRIPTION

Linux::Info::FileStats gathers file statistics from the virtual /proc filesystem (procfs).

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

FILE STATISTICS

Generated by /proc/sys/fs/file-nr, /proc/sys/fs/inode-nr and /proc/sys/fs/dentry-state.

    fhalloc    -  Number of allocated file handles.
    fhfree     -  Number of free file handles.
    fhmax      -  Number of maximum file handles.
    inalloc    -  Number of allocated inodes.
    infree     -  Number of free inodes.
    inmax      -  Number of maximum inodes.
    dentries   -  Dirty directory cache entries.
    unused     -  Free diretory cache size.
    agelimit   -  Time in seconds the dirty cache entries can be reclaimed.
    wantpages  -  Pages that are requested by the system when memory is short.

If youre looking for information about inodes usage in a mouint point, most probably you want to take a look at Linux::Info::DiskUsage module. This module gets information about inodes from /proc as Linux::Info::DiskUsage does, but documentation about this specific part of /proc is obscure, so you're on your own to find out which module to use.

METHODS

new()

Call new() to create a new object.

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

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

     Linux::Info::FileStats->new(
        files => {
            # This is the default
            path     => '/proc',
            file_nr  => 'sys/fs/file-nr',
            inode_nr => 'sys/fs/inode-nr',
            dentries => 'sys/fs/dentry-state',
        }
    );

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