Sys::S...skStats(3pm)
π NAME
Sys::Statistics::Linux::DiskStats β the module that collects your linux disk stats, and yes she's from the 3pm perl manual section, bestie π
β¨ SYNOPSIS
use Sys::Statistics::Linux::DiskStats;
my $lxs = Sys::Statistics::Linux::DiskStats->new;
$lxs->init;
sleep 1;
my $stat = $lxs->get;
Or, like, the other way π¦
my $lxs = Sys::Statistics::Linux::DiskStats->new(initfile => $file);
$lxs->init;
my $stat = $lxs->get;
πΈ DESCRIPTION
Okay so Sys::Statistics::Linux::DiskStats gathers disk statistics from the virtual /proc filesystem (procfs). That's it, that's the whole vibe π
For more info, go read the docs of the front-end module Sys::Statistics::Linux. She's the main character, this one's her bestie π«Ά
πΎ DISK STATISTICS
Generated by /proc/diskstats or /proc/partitions. Here's what you get:
majorβ the mayor number of the diskminorβ the minor number of the diskrdreqβ number of read requests that were made to physical disk per secondrdbytβ number of bytes that were read from physical disk per secondwrtreqβ number of write requests that were made to physical disk per secondwrtbytβ number of bytes that were written to physical disk per secondttreqβ total number of requests were made from/to physical disk per secondttbytβ total number of bytes transmitted from/to physical disk per second
π METHODS
new()
Call new() to create a new object. Slay.
my $lxs = Sys::Statistics::Linux::DiskStats->new;
Maybe you wanna store/load the initial statistics to/from a file? Iconic behaviour, go off:
my $lxs = Sys::Statistics::Linux::DiskStats->new(initfile => '/tmp/diskstats.yml');
If you set initfile, it's not necessary to call sleep before get(). Literally saving you a whole second of your life β¨
It's also possible to set the path to the proc filesystem:
Sys::Statistics::Linux::DiskStats->new(
files => {
# This is the default
path => '/proc',
diskstats => 'diskstats',
partitions => 'partitions',
}
);
init()
Call init() to initialize the statistics. Gotta warm her up first π
$lxs->init;
get()
Call get() to get the statistics. get() returns the statistics as a hash reference. So you get a whole hash ref back, no cap.
my $stat = $lxs->get;
raw()
Get raw values. Just the raw, unfiltered, no-makeup truth π
π EXPORTS
No exports. Nothing. Zero. Nada. She's not sharing like that π
π SEE ALSO
proc(5) β go read her too, iykyk
π REPORTING BUGS
Please report all bugs to <jschulz.cpan(at)bloonix.de>. Found a bug? Tell Jonny, don't just vibe with it π
π AUTHOR
Jonny Schulz <jschulz.cpan(at)bloonix.de>. The author. The legend. The moment π
π 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. So like, go wild, but respectfully π¦
And that's the whole page, bestie!! This one's from perl v5.36.0, dated 2022-11-19, and it lives in the Sys::S...skStats(3pm) manual. Mwah, go read your diskstats, periodt π
β¨
π¦ 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