File: processes.pl

package info (click to toggle)
libsys-statistics-linux-perl 0.66-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 424 kB
  • sloc: perl: 1,655; makefile: 2
file content (19 lines) | stat: -rwxr-xr-x 503 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Sys::Statistics::Linux;
use Sys::Statistics::Linux::Processes;

# the default value for the following keys are pages:
#   size, resident, share, trs, drs, lrs, dtp
#
# set PAGES_TO_BYTES to the pagesize of your system if
# you want bytes instead of pages
$Sys::Statistics::Linux::Processes::PAGES_TO_BYTES = 4096;

my $sys  = Sys::Statistics::Linux->new(processes => 1);
sleep 1;
my $stat = $sys->get();

print Dumper($stat->{processes});