NAME

Sys::Statistics::Linux::Processes - Collect linux process statistics.

SYNOPSIS

use Sys::Statistics::Linux::Processes;

my $lxs = Sys::Statistics::Linux::Processes->new;
$lxs->init;
sleep 1;
my $stat = $lxs->get;

DESCRIPTION

Sys::Statistics::Linux::Processes gathers process informations from the virtual /proc filesystem (procfs).

For more informations read the documentation of the front-end module Sys::Statistics::Linux.

PROCESS STATISTICS

Generated by /proc/<number>/statm, /proc/<number>/stat, /proc/<number>/status, /proc/<number>/cmdline and getpwuid().

Note that if /etc/passwd isn't readable, the key owner is set to N/a.

ppid      -  The parent process ID of the process.
nlwp      -  The number of light weight processes that runs by this process.
owner     -  The owner name of the process.
pgrp      -  The group ID of the process.
state     -  The status of the process.
session   -  The session ID of the process.
ttynr     -  The tty the process use.
minflt    -  The number of minor faults the process made.
cminflt   -  The number of minor faults the child process made.
mayflt    -  The number of mayor faults the process made.
cmayflt   -  The number of mayor faults the child process made.
stime     -  The number of jiffies the process have beed scheduled in kernel mode.
utime     -  The number of jiffies the process have beed scheduled in user mode.
ttime     -  The number of jiffies the process have beed scheduled (user + kernel).
cstime    -  The number of jiffies the process waited for childrens have been scheduled in kernel mode.
cutime    -  The number of jiffies the process waited for childrens have been scheduled in user mode.
prior     -  The priority of the process (+15).
nice      -  The nice level of the process.
sttime    -  The time in jiffies the process started after system boot.
actime    -  The time in D:H:M:S (days, hours, minutes, seconds) the process is active.
vsize     -  The size of virtual memory of the process.
nswap     -  The size of swap space of the process.
cnswap    -  The size of swap space of the childrens of the process.
cpu       -  The CPU number the process was last executed on.
size      -  The total program size of the process.
resident  -  Number of resident set size, this includes the text, data and stack space.
share     -  Total size of shared pages of the process.
trs       -  Total text size of the process.
drs       -  Total data/stack size of the process.
lrs       -  Total library size of the process.
dtp       -  Total size of dirty pages of the process (unused since kernel 2.6).
cmd       -  Command of the process.
cmdline   -  Command line of the process.

METHODS

new()

Call new() to create a new object.

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

It's possible to handoff an array reference with a PID list.

my $lxs = Sys::Statistics::Linux::Processes->new([ 1, 2, 3 ]);

init()

Call init() to initialize the statistics.

$lxs->init;

get()

Call get() to get the statistics. get() returns the statistics as a hash reference.

my $stat = $lxs->get;

EXPORTS

No exports.

SEE ALSO

proc(5)

perldoc -f getpwuid

REPORTING BUGS

Please report all bugs to <jschulz.cpan(at)bloonix.de>.

AUTHOR

Jonny Schulz <jschulz.cpan(at)bloonix.de>.

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.