1Sys::Statistics::Linux:U:sPerrocCSotnattrsi(b3u)ted PerlSyDso:c:uSmteanttiasttiiocns::Linux::ProcStats(3)
2
3
4

NAME

6       Sys::Statistics::Linux::ProcStats - Collect linux process statistics.
7

SYNOPSIS

9           use Sys::Statistics::Linux::ProcStats;
10
11           my $lxs = Sys::Statistics::Linux::ProcStats->new;
12           $lxs->init;
13           sleep 1;
14           my $stat = $lxs->get;
15
16       Or
17
18           my $lxs = Sys::Statistics::Linux::ProcStats->new(initfile => $file);
19           $lxs->init;
20           my $stat = $lxs->get;
21

DESCRIPTION

23       Sys::Statistics::Linux::ProcStats gathers process statistics from the
24       virtual /proc filesystem (procfs).
25
26       For more information read the documentation of the front-end module
27       Sys::Statistics::Linux.
28

IMPORTANT

30       I renamed key "procs_blocked" to "blocked"!
31

LOAD AVERAGE STATISTICS

33       Generated by /proc/stat and /proc/loadavg.
34
35           new       -  Number of new processes that were produced per second.
36           runqueue  -  The number of currently executing kernel scheduling entities (processes, threads).
37           count     -  The number of kernel scheduling entities that currently exist on the system (processes, threads).
38           blocked   -  Number of processes blocked waiting for I/O to complete (Linux 2.5.45 onwards).
39           running   -  Number of processes in runnable state (Linux 2.5.45 onwards).
40

METHODS

42   new()
43       Call new() to create a new object.
44
45           my $lxs = Sys::Statistics::Linux::ProcStats->new;
46
47       Maybe you want to store/load the initial statistics to/from a file:
48
49           my $lxs = Sys::Statistics::Linux::ProcStats->new(initfile => '/tmp/procstats.yml');
50
51       If you set "initfile" it's not necessary to call sleep before get().
52
53       It's also possible to set the path to the proc filesystem.
54
55            Sys::Statistics::Linux::ProcStats->new(
56               files => {
57                   # This is the default
58                   path    => '/proc',
59                   loadavg => 'loadavg',
60                   stat    => 'stat',
61               }
62           );
63
64   init()
65       Call init() to initialize the statistics.
66
67           $lxs->init;
68
69   get()
70       Call get() to get the statistics. get() returns the statistics as a
71       hash reference.
72
73           my $stat = $lxs->get;
74
75   raw()
76       Get raw values.
77

EXPORTS

79       No exports.
80

SEE ALSO

82       proc(5)
83

REPORTING BUGS

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

AUTHOR

88       Jonny Schulz <jschulz.cpan(at)bloonix.de>.
89
91       Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved.
92
93       This program is free software; you can redistribute it and/or modify it
94       under the same terms as Perl itself.
95
96
97
98perl v5.36.0                      2023-01-2S0ys::Statistics::Linux::ProcStats(3)
Impressum