Sys::S...ckStats(3pm)
π Sys::Statistics::Linux::SockStats β the perl(3pm) page, bestie edition π
okay so this is Sys::Statistics::Linux::SockStats, straight outta the User Contributed Perl Documentation corner of your man pages. It's a lil module that goes and peeks at your Linux sockets. Yes, those sockets. The vibe? Immaculate. The data? Delicious. Let's go. β¨
πΈ NAME πΈ
Sys::Statistics::Linux::SockStats</purl> β literally just here to collect linux socket statistics. That's the whole job. She's focused. She's booked. She's collecting socket stats. π
π¦ SYNOPSIS π¦
use Sys::Statistics::Linux::SockStats;
my $lxs = Sys::Statistics::Linux::SockStats->new;
my $stat = $lxs->get;
That's it. That's the whole ritual. Two lines and you're in. π
π DESCRIPTION π
So Sys::Statistics::Linux::SockStats gathers socket statistics from the virtual /proc filesystem (aka procfs). It's giving "I know what your kernel is up to." π
And if you want the full lore β the extended cinematic universe β go read the docs for the front-end module Sys::Statistics::Linux. This module is like the side character that ate, fr fr.
β SOCKET STATISTICS β
These lil beauties are generated by /proc/net/sockstat. Not me being obsessed with a text file in /proc β it's just that good.
usedβ total number of used sockets. The whole headcount. π―tcpβ number of tcp sockets in use.udpβ number of udp sockets in use.rawβ number of raw sockets in use. Spicy. π₯ipfragβ number of ip fragments in use (only available by kernels > 2.2). heads up bestie: this one only shows up if your kernel is newer than 2.2, so if it ghosts you, that's why. π
π METHODS π
π new()
Call new() to create a new object. Fresh start, new me, new SockStats. β¨
my $lxs = Sys::Statistics::Linux::SockStats->new;
And guess what β it's possible to set the path to the proc filesystem. Customize her. Make her yours. π«Ά
Sys::Statistics::Linux::SockStats->new(
files => {
# This is the default
path => '/proc',
sockstat => 'net/sockstat',
}
);
note the# This is the defaultcomment right there in the code β/procandnet/sockstatare the defaults, so if you don't pass anything, that's what you get. no cap.
π get()
Call get() to get the statistics. And get() returns the statistics as a hash reference. A whole hashref of socket tea. β
my $stat = $lxs->get;
π§ EXPORTS π§
No exports.</purl>
Literally none. She keeps it to herself. Boundaries! Iconic behavior. π
π SEE ALSO π
Go read it, bestie. iykyk. π
π REPORTING BUGS π
Please report all bugs to <jschulz.cpan(at)bloonix.de>.
Not some bugs. All of them. Don't be shy, don't be mysterious β just email. π
π AUTHOR π
Jonny Schulz <jschulz.cpan(at)bloonix.de>.
The mastermind. The main character. We stan. π«Ά
πΈ 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β¦ slay, go forth, remix responsibly. π
and that's the page, bestie!! πβ¨ This whole thing came to you courtesy of perl v5.36.0 and it was last dated 2022-11-19, signed off at the bottom of the original as Sys::S...ckStats(3pm) (she got truncated, it happens to the best of us π). mwah, go collect some socket stats π ππ¦
π¦ 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