NAME

Linux::Info::FileStats - Collect linux file statistics.

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 of Alceu Rodrigues de Freitas Junior, <glasswalk3r@yahoo.com.br>

This file is part of Linux Info project.

Linux-Info is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Linux-Info is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Linux Info. If not, see <http://www.gnu.org/licenses/>.