1Sys::Statistics::Linux:U:sPegrSwCSotnattrsi(b3u)ted PerlSyDso:c:uSmteanttiasttiiocns::Linux::PgSwStats(3)
2
3
4
6 Sys::Statistics::Linux::PgSwStats - Collect linux paging and swapping
7 statistics.
8
10 use Sys::Statistics::Linux::PgSwStats;
11
12 my $lxs = Sys::Statistics::Linux::PgSwStats->new;
13 $lxs->init;
14 sleep 1;
15 my $stat = $lxs->get;
16
17 Or
18
19 my $lxs = Sys::Statistics::Linux::PgSwStats->new(initfile => $file);
20 $lxs->init;
21 my $stat = $lxs->get;
22
24 Sys::Statistics::Linux::PgSwStats gathers paging and swapping
25 statistics from the virtual /proc filesystem (procfs).
26
27 For more information read the documentation of the front-end module
28 Sys::Statistics::Linux.
29
31 Generated by /proc/stat or /proc/vmstat.
32
33 pgpgin - Number of pages the system has paged in from disk per second.
34 pgpgout - Number of pages the system has paged out to disk per second.
35 pswpin - Number of pages the system has swapped in from disk per second.
36 pswpout - Number of pages the system has swapped out to disk per second.
37
38 The following statistics are only available by kernels from 2.6.
39
40 pgfault - Number of page faults the system has made per second (minor + major).
41 pgmajfault - Number of major faults per second the system required loading a memory page from disk.
42
44 new()
45 Call "new()" to create a new object.
46
47 my $lxs = Sys::Statistics::Linux::PgSwStats->new;
48
49 Maybe you want to store/load the initial statistics to/from a file:
50
51 my $lxs = Sys::Statistics::Linux::PgSwStats->new(initfile => '/tmp/pgswstats.yml');
52
53 If you set "initfile" it's not necessary to call sleep before "get()".
54
55 It's also possible to set the path to the proc filesystem.
56
57 Sys::Statistics::Linux::PgSwStats->new(
58 files => {
59 # This is the default
60 path => '/proc',
61 stat => 'stat',
62 vmstat => 'vmstat',
63 }
64 );
65
66 init()
67 Call "init()" to initialize the statistics.
68
69 $lxs->init;
70
71 get()
72 Call "get()" to get the statistics. "get()" returns the statistics as a
73 hash reference.
74
75 my $stat = $lxs->get;
76
77 raw()
78 Get raw values.
79
81 No exports.
82
84 proc(5)
85
87 Please report all bugs to <jschulz.cpan(at)bloonix.de>.
88
90 Jonny Schulz <jschulz.cpan(at)bloonix.de>.
91
93 Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved.
94
95 This program is free software; you can redistribute it and/or modify it
96 under the same terms as Perl itself.
97
98
99
100perl v5.28.1 2019-02-0S2ys::Statistics::Linux::PgSwStats(3)