1Unix::Statgrab::sg_cpu_UssteartsC(o3n)tributed Perl DocuUmneinxt:a:tSitoantgrab::sg_cpu_stats(3)
2
3
4
6 Unix::Statgrab::sg_cpu_stats - container for libstatgrab CPU statistics
7
9 "Unix::Statgrab::sg_cpu_stats" is a Perl package name providing
10 accessors to bundled libstatgrab sg_cpu_stats <http://www.i-
11 scream.org/libstatgrab/docs/sg_get_cpu_stats.3.html> data collection.
12
14 nentries
15 Returns the number of entries in the container.
16
17 systime
18 Returns the seconds since Epoch (0:00:00 on January, 1st 1970) of the
19 time measure the CPU statistics.
20
21 as_list
22 Deprecated alias of "fetchall_hash"
23
24 fetchall_hash
25 Returns all records from sg_cpu_stats <http://www.i-
26 scream.org/libstatgrab/docs/sg_get_cpu_stats.3.html> container as list
27 of hash containing each datum name as key and the datum as value.
28
29 fetchall_array
30 Returns all records from sg_cpu_stats <http://www.i-
31 scream.org/libstatgrab/docs/sg_get_cpu_stats.3.html> container as list
32 of arrays containing the values in following order:
33
34 (user kernel idle iowait swap nice total
35 context_switches voluntary_context_switches involuntary_context_switches
36 syscalls interrupts soft_interrupts
37 systime)
38
39 in that order without leading headline.
40
41 fetchall_table
42 Returns all records from sg_cpu_stats <http://www.i-
43 scream.org/libstatgrab/docs/sg_get_cpu_stats.3.html> container as list
44 of arrays containing the values in following order:
45
46 (user kernel idle iowait swap nice total
47 context_switches voluntary_context_switches involuntary_context_switches
48 syscalls interrupts soft_interrupts
49 systime)
50
51 in that order including leading headline.
52
53 fetchrow_arrayref($row = 0)
54 Returns one row as array containing values as above.
55
56 fetchall_arrayref
57 Returns all records from sg_cpu_stats <http://www.i-
58 scream.org/libstatgrab/docs/sg_get_cpu_stats.3.html> container as array
59 of arrays without header.
60
61 fetchrow_hashref($row = 0)
62 Returns one row as hash containing "{ user => $self.user($row), kernel
63 => ... }".
64
65 fetchall_hashref
66 Returns all records from sg_cpu_stats <http://www.i-
67 scream.org/libstatgrab/docs/sg_get_cpu_stats.3.html> container as array
68 of hashes.
69
70 colnames
71 Returns list of column names: "(user kernel idle iowait swap nice total
72 context_switches voluntary_context_switches
73 involuntary_context_switches syscalls interrupts soft_interrupts
74 systime)"
75
76 user
77 Clock ticks in user mode
78
79 kernel
80 Clock ticks in kernel mode
81
82 idle
83 Clock ticks while idle
84
85 iowait
86 Clock ticks while waiting for outstanding I/O
87
88 swap
89 Clock ticks while waiting for swap
90
91 nice
92 Clock ticks in user mode with nice priority
93
94 total
95 Overall clock ticks
96
97 context_switches
98 Overall Context switches
99
100 voluntary_context_switches
101 Voluntary context switches (See sched_yield(2)
102 <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html>)
103
104 involuntary_context_switches
105 Involuntary context switches
106
107 syscalls
108 Number of syscalls
109
110 interrupts
111 Amount of interrupts happened
112
113 soft_interrupts
114 Amount of software triggered interrupts
115
116 get_cpu_stats_diff
117 Provides the difference between the last measurement and the recent
118 one.
119
120 $recent->get_cpu_stats_diff($last);
121
122 get_cpu_percents
123 Provides a percentage representation of the single cpu ticks measured.
124
126 Jens Rehsack, <rehsack AT cpan.org>
127
129 Copyright (C) 2012-2018 by Jens Rehsack
130
131 This library is free software; you can redistribute it and/or modify it
132 under the terms of the GNU Lesser General Public License as published
133 by the Free Software Foundation; either version 2.1 of the License, or
134 (at your option) any later version.
135
136
137
138perl v5.34.0 2022-01-21 Unix::Statgrab::sg_cpu_stats(3)