Linux::Info::FileStats - Collect linux file statistics.
use Linux::Info::FileStats; my $lxs = Linux::Info::FileStats->new; my $stat = $lxs->get;
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.
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.
Call new() to create a new object.
new()
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', } );
Call get() to get the statistics. get() returns the statistics as a hash reference.
get()
my $stat = $lxs->get;
Nothing.
proc(5)
Linux::Info
Linux::Info::DiskUsage
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
This software is copyright (c) 2015 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
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/>.
To install Linux::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Linux::Info
CPAN shell
perl -MCPAN -e shell install Linux::Info
For more information on module installation, please visit the detailed CPAN module installation guide.