1Sys::Statistics::Linux:U:sDeirskCSotnattrsi(b3u)ted PerlSyDso:c:uSmteanttiasttiiocns::Linux::DiskStats(3)
2
3
4
6 Sys::Statistics::Linux::DiskStats - Collect linux disk statistics.
7
9 use Sys::Statistics::Linux::DiskStats;
10
11 my $lxs = Sys::Statistics::Linux::DiskStats->new;
12 $lxs->init;
13 sleep 1;
14 my $stat = $lxs->get;
15
16 Or
17
18 my $lxs = Sys::Statistics::Linux::DiskStats->new(initfile => $file);
19 $lxs->init;
20 my $stat = $lxs->get;
21
23 Sys::Statistics::Linux::DiskStats gathers disk 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
30 Generated by /proc/diskstats or /proc/partitions.
31
32 major - The mayor number of the disk
33 minor - The minor number of the disk
34 rdreq - Number of read requests that were made to physical disk per second.
35 rdbyt - Number of bytes that were read from physical disk per second.
36 wrtreq - Number of write requests that were made to physical disk per second.
37 wrtbyt - Number of bytes that were written to physical disk per second.
38 ttreq - Total number of requests were made from/to physical disk per second.
39 ttbyt - Total number of bytes transmitted from/to physical disk per second.
40
42 new()
43 Call "new()" to create a new object.
44
45 my $lxs = Sys::Statistics::Linux::DiskStats->new;
46
47 Maybe you want to store/load the initial statistics to/from a file:
48
49 my $lxs = Sys::Statistics::Linux::DiskStats->new(initfile => '/tmp/diskstats.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::DiskStats->new(
56 files => {
57 # This is the default
58 path => '/proc',
59 diskstats => 'diskstats',
60 partitions => 'partitions',
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
79 No exports.
80
82 proc(5)
83
85 Please report all bugs to <jschulz.cpan(at)bloonix.de>.
86
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.28.1 2019-02-0S2ys::Statistics::Linux::DiskStats(3)