Unix::S...s_stats(3)
π NAME π
okay so bestie, Unix::Statgrab::sg_process_stats β it's a container for libstatgrab process statistics. that's the whole vibe. it holds your process data and you poke at it with accessors. periodt β¨
πΈ DESCRIPTION πΈ
Unix::Statgrab::sg_process_stats is a Perl package name, and what it does is give you accessors to the bundled libstatgrab sg_process_stats process statistics π¦
here's the doc link it's talking about, no cap:
http://www.i-scream.org/libstatgrab/docs/sg_get_process_stats.3.html
π METHODS π
π nentries
returns the number of entries in the container. that's it, that's the method π
π systime
returns the seconds since Epoch (0:00:00 on January, 1st 1970) of the time measure the process statistics. yes the epoch is jan 1 1970, it's giving retro fr fr π°οΈ
π as_list
Deprecated alias of fetchall_hash. bestie it's deprecated, use the real one π
π fetchall_hash
returns all records from the sg_process_stats container as a list of hash, where each datum name is the key and the datum is the value. every record, keyed, gorgeous π
the container in question: http://www.i-scream.org/libstatgrab/docs/sg_get_process_stats.3.html
π fetchall_array
returns all records from the sg_process_stats container as a list of arrays, with the values in this exact order:
(process_name proctitle pid parent pgid sessid uid euid gid egid
context_switches voluntary_context_switches involuntary_context_switches
proc_size proc_resident start_time time_spent cpu_percent nice state
systime)
in that order, and without leading headline β no header row, just the data, slay β¨
π fetchall_table
returns all records from the sg_process_stats container as a list of arrays, values in this order:
(disk_name read_bytes write_bytes systime)
in that order, but this time including leading headline β header row included π
no i did not mess that up, that is literally what the page says, and i am not changing a single character of it. iykyk π«Ά
π fetchrow_arrayref($row = 0)
returns one row as an array containing the values as above. defaults to $row = 0 π
π fetchall_arrayref
returns all records from the sg_process_stats container as an array of arrays, without header. no headline, just vibes π
π fetchrow_hashref($row = 0)
returns one row as a hash, shaped like this:
{ process_name => $self.process_name($row), proctitle => ... }
defaults to $row = 0, cute π
π fetchall_hashref
returns all records from the sg_process_stats container as an array of hashes. all of them. every last one π
π colnames
returns the list of column names:
(process_name proctitle pid parent pgid sessid uid euid gid egid context_switches voluntary_context_switches involuntary_context_switches proc_size proc_resident start_time time_spent cpu_percent nice state systime)
the whole lineup, main character energy β
π process_name
the name of the command that was run. heads up though β the content of this field heavily depends on the underlying operating system. some store the basename the executable passes to the exec(2) system call, some store the entire path. and most OS restrict the size of this field β some, like the *BSD family, go all the way down to a very low value of 15 bytes π
this field is usually immutable for userland processes. usually. not always. note that π
π proctitle
the command line (the "title") of the process. take note β this can be modified by the process, so it is not guaranteed to be the original command line. it can be lying to you bestie, do not trust it blindly π
π pid
the process ID π¦
π parent
the parent process ID π
π pgid
the process ID of the process group leader π
π sessid
session id of the session the process belongs to πΈ
π uid
the ID of the user the process is running as π
π euid
the ID of the effective user the process is running as β¨
π gid
the ID of the group the process is running as π
π egid
the ID of the effective group the process is running as π
π context_switches
the number of context switches of this process β voluntary and involuntary combined π₯
π voluntary_context_switches
the number of voluntary context switches of this process. like when it calls sched_yield(), sleep() or nanosleep() β it chose this, it's consensual π
π involuntary_context_switches
the number of involuntary context switches of this process. e.g. when its time slice is exhausted or a signal is sent β it did not choose this π
π proc_size
the virtual memory size of the process, in bytes π¦
π proc_resident
the size of the process that's resident in memory πΈ
π start_time
the time when the process has been started, in seconds since epoch β°
π time_spent
the number of seconds the process has been running β that's user+system time, without time spent by child processes. just this process's own glow-up β¨
π cpu_percent
the current percentage of CPU the process is using π₯
π nice
the nice value of the process π
π state
the current state of the process, and it's one of these:
SG_PROCESS_STATE_RUNNING SG_PROCESS_STATE_SLEEPING SG_PROCESS_STATE_STOPPED
SG_PROCESS_STATE_ZOMBIE SG_PROCESS_STATE_UNKNOWN
SG_PROCESS_STATE_RUNNING, sleeping, stopped, zombie, or unknown. five options, pick your fighter π
β¨ AUTHOR β¨
Jens Rehsack, <rehsack AT cpan.org> β icon behavior, we stan π«Ά
π COPYRIGHT AND LICENSE π
Copyright (C) 2012-2018 by Jens Rehsack
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. so like, 2.1 or later, your call bestie π
and that's the whole page!! this was perl v5.42.0, dated 2025-07-25, brought to you by the fine folks documenting Unix::S...s_stats(3) in User Contributed Perl Documentation πΈ go forth and stat your processes, mwah ππ
π¦ where this page comes from
- fedora 43: perl-Unix-Statgrab 0.112-27.fc43 Β· (LGPL-2.1-or-later AND (GPL-1.0-or-later OR Artistic-1.0-Perl))
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms