Sys::S...LoadAVG(3pm)

πŸ“¦
version 0.66 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Sys::S...LoadAVG β€” the perl manpage but make it cute πŸ’–

okay so bestie, you're reading the User Contributed Perl Documentation for Sys::Statistics::Linux::LoadAVG (yes the manual name is literally Sys::S...LoadAVG(3pm), it's giving ✨abbreviated✨ but we move). Buckle up, this one's short and sweet and honestly kinda iconic.


✨ NAME ✨

Sys::Statistics::Linux::LoadAVG β€” Collect linux load average statistics. πŸ§πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

use Sys::Statistics::Linux::LoadAVG;

my $lxs  = Sys::Statistics::Linux::LoadAVG->new;
my $stat = $lxs->get;

that's it. that's the whole vibe. two lines and you're done, no cap. 🫢


🌸 DESCRIPTION 🌸

Sys::Statistics::Linux::LoadAVG gathers the load average from the virtual /proc filesystem (aka procfs). it just... reads it. respectfully. πŸ‘‘

if you want the full tea, go read the docs of the front-end module Sys::Statistics::Linux. it's the main character, this module is the bestie holding its iced coffee. πŸ’–


πŸ”₯ LOAD AVERAGE STATISTICS πŸ”₯

Generated by /proc/loadavg. three little numbers, one big mood:

  • avg_1 β€” The average processor workload of the last minute. ⏱️
  • avg_5 β€” The average processor workload of the last five minutes. ⏳
  • avg_15 β€” The average processor workload of the last fifteen minutes. πŸ•°οΈ

ngl it's giving "how stressed is my CPU" energy and i am obsessed. 😭


πŸ¦‹ METHODS πŸ¦‹

new()

Call new() to create a new object. fresh, brand new, never-been-used. ✨

my $lxs = Sys::Statistics::Linux::LoadAVG->new;

It's possible to set the path to the proc filesystem. like, if your procfs is somewhere else (mysterious of you, but ok πŸ•΅οΈ):

 Sys::Statistics::Linux::LoadAVG->new(
    files => {
        # This is the default
        path    => '/proc',
        loadavg => 'loadavg',
    }
);
πŸ“Œ that # This is the default comment is doing so much heavy lifting, do not ignore it. the defaults are path β†’ /proc and loadavg β†’ loadavg.

get()

Call get() to get the statistics. get() returns the statistics as a hash reference. like, it hands you the whole hashref and says "here bestie, take it". 🫴

my $stat = $lxs->get;

πŸ’œ EXPORTS πŸ’œ

No exports. nothing. zero. nada. it's an independent queen and it will not be exporting anything today. πŸ’…


🌈 SEE ALSO 🌈

go read it, iykyk. πŸ“–


πŸ’€ REPORTING BUGS πŸ’€

Please report all bugs to <jschulz.cpan(at)bloonix.de>. found a bug? don't gatekeep it, send it in. fr fr. πŸ›


πŸ‘‘ AUTHOR πŸ‘‘

Jonny Schulz <jschulz.cpan(at)bloonix.de>. the author. the moment. the legend. πŸ™Œ


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.


and that's the whole page bestie!! this beauty shipped as part of perl v5.36.0, dated 2022-11-19, and it goes out to you from Sys::S...LoadAVG(3pm) πŸ’–βœ¨πŸŽ€ slay, go read your load averages, drink some water, and remember: avg_15 always tells the truth. periodt. πŸŒΈπŸ¦‹β­

πŸ“¦ where this page comes from