Sys::S...leStats(3pm)
π Sys::Statistics::Linux::FileStats π
okay bestie so this is a page from the User Contributed Perl Documentation collection, and it's literally all about collecting linux file statistics. no cap. it's giving very specific, very useful, very slay.
β¨ NAME β¨
Sys::Statistics::Linux::FileStats β collect linux file statistics. that's the whole job. she's focused. she's an icon.
πΈ SYNOPSIS πΈ
okay so this is the whole vibe in four lines, look:
use Sys::Statistics::Linux::FileStats;
my $lxs = Sys::Statistics::Linux::FileStats->new;
my $stat = $lxs->get;
that's it. that's the post. build an object, grab the stats. π
π¦ DESCRIPTION π¦
Sys::Statistics::Linux::FileStats gathers file statistics from the virtual /proc filesystem (aka procfs). it's not out here reading your actual files, she's reading the virtual one. huge difference. very demure.
if you want the full picture, go read the documentation of the front-end module Sys::Statistics::Linux. this one's like the little sister module. still iconic though.
π FILE STATISTICS π
these beauties are generated by /proc/sys/fs/file-nr, /proc/sys/fs/inode-nr and /proc/sys/fs/dentry-state. three files, one glow-up. β¨
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 directory 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.
ten little stats, all living their best life. memorize them for the vibe check. π«Ά
π METHODS π
new()
call new() to create a new object. it's giving constructor. it's giving main character energy.
my $lxs = Sys::Statistics::Linux::FileStats->new;
and plot twist: you can also set the path to the proc filesystem. customize your little heart out:
Sys::Statistics::Linux::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',
}
);
note the # This is the default comment in there β those paths are the defaults, so if you don't pass anything you get exactly that. don't come for me, come for the defaults. π
get()
call get() to get the statistics. get() returns the statistics as a hash reference. yes, a hash reference. she's returning data, not vibes. (well, both.)
my $stat = $lxs->get;
π EXPORTS π
no exports.
literally none. zero. the girl exports nothing, she just exists and delivers. periodt. π
π SEE ALSO π
one reference. quality over quantity, bestie.
π REPORTING BUGS π
please report all bugs to <jschulz.cpan(at)bloonix.de>. be nice about it, they're doing their best. π
β AUTHOR β
Jonny Schulz <jschulz.cpan(at)bloonix.de>. the moment. the legend. π«Ά
π COPYRIGHT π
Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay so that's the whole page, and fr fr you're now a Sys::Statistics::Linux::FileStats expert. go collect those file statistics, bestie, you've earned it. π§π
and for the cute sign-off: this gorgeous little page came from perl v5.36.0, dated 2022-11-19 β shoutout to that version and that date, they understood the assignment. πΈ
π¦ where this page comes from
- debian bookworm: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms