sys-proctable 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES.rdoc +5 -0
- data/lib/linux/sys/proctable.rb +106 -98
- data/lib/sys/proctable/version.rb +1 -1
- data/spec/sys_proctable_all_spec.rb +1 -1
- data/spec/sys_proctable_linux_spec.rb +21 -5
- data/sys-proctable.gemspec +1 -1
- metadata +1 -1
- metadata.gz.sig +4 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 01c653a363b9c37b67d34370e882e24aefc772c95677ee7420b9601f279c2e9b
|
|
4
|
+
data.tar.gz: c3dbf4252b810a0abd69bdc3d401a653ae8b8e24d31d8be15fea7d5ddd37f7a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f97e3368e08424eb1ac80dd50865f0803066de539fd93defebfb8dbd8591d44447a24a5621555b2b6e29f5f72ae33f03be2b973d3106ad87ecd1bcef67fb8eb
|
|
7
|
+
data.tar.gz: a17fd29c3cfc2aed02ab884467aa24f403258aa8bc9f4f9fa084892685d6898992808625e3dacc18d1616232f11ad8c2b7ac8ce21b80fdd3bd8faadb4e733791
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/CHANGES.rdoc
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
== 1.2.5 - 19-Jun-2020
|
|
2
|
+
* Added the delayacct_blkio_ticks, guest_time, and cguest_time fields on Linux.
|
|
3
|
+
These require 2.6.18 or later, but will simply be nil on earlier versions.
|
|
4
|
+
* Added the rsslim synonym for the rlim field for Linux.
|
|
5
|
+
|
|
1
6
|
== 1.2.4 - 18-Jun-2020
|
|
2
7
|
* Added the num_threads field for Linux. This was originally a dead field in
|
|
3
8
|
older versions of Linux that was skipped, but as of Linux 2.6+ it actually
|
data/lib/linux/sys/proctable.rb
CHANGED
|
@@ -20,63 +20,67 @@ module Sys
|
|
|
20
20
|
@boot_time = IO.read("/proc/stat")[/btime.*/].split.last.to_i rescue nil
|
|
21
21
|
|
|
22
22
|
@fields = [
|
|
23
|
-
'cmdline',
|
|
24
|
-
'cwd',
|
|
25
|
-
'environ',
|
|
26
|
-
'exe',
|
|
27
|
-
'fd',
|
|
28
|
-
'root',
|
|
29
|
-
'pid',
|
|
30
|
-
'comm',
|
|
31
|
-
'state',
|
|
32
|
-
'ppid',
|
|
33
|
-
'pgrp',
|
|
34
|
-
'session',
|
|
35
|
-
'tty_nr',
|
|
36
|
-
'tpgid',
|
|
37
|
-
'flags',
|
|
38
|
-
'minflt',
|
|
39
|
-
'cminflt',
|
|
40
|
-
'majflt',
|
|
41
|
-
'cmajflt',
|
|
42
|
-
'utime',
|
|
43
|
-
'stime',
|
|
44
|
-
'cutime',
|
|
45
|
-
'cstime',
|
|
46
|
-
'priority',
|
|
47
|
-
'nice',
|
|
48
|
-
'num_threads',
|
|
49
|
-
'itrealvalue',
|
|
50
|
-
'starttime',
|
|
51
|
-
'vsize',
|
|
52
|
-
'rss',
|
|
53
|
-
'rlim',
|
|
54
|
-
'
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
65
|
-
'
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
77
|
-
'
|
|
78
|
-
'
|
|
79
|
-
'
|
|
23
|
+
'cmdline', # Complete command line
|
|
24
|
+
'cwd', # Current working directory
|
|
25
|
+
'environ', # Environment
|
|
26
|
+
'exe', # Actual pathname of the executed command
|
|
27
|
+
'fd', # File descriptors open by process
|
|
28
|
+
'root', # Root directory of process
|
|
29
|
+
'pid', # Process ID
|
|
30
|
+
'comm', # Filename of executable
|
|
31
|
+
'state', # Single character state abbreviation
|
|
32
|
+
'ppid', # Parent process ID
|
|
33
|
+
'pgrp', # Process group
|
|
34
|
+
'session', # Session ID
|
|
35
|
+
'tty_nr', # TTY (terminal) associated with the process
|
|
36
|
+
'tpgid', # Group ID of the TTY
|
|
37
|
+
'flags', # Kernel flags
|
|
38
|
+
'minflt', # Number of minor faults
|
|
39
|
+
'cminflt', # Number of minor faults of waited-for children
|
|
40
|
+
'majflt', # Number of major faults
|
|
41
|
+
'cmajflt', # Number of major faults of waited-for children
|
|
42
|
+
'utime', # Number of user mode jiffies
|
|
43
|
+
'stime', # Number of kernel mode jiffies
|
|
44
|
+
'cutime', # Number of children's user mode jiffies
|
|
45
|
+
'cstime', # Number of children's kernel mode jiffies
|
|
46
|
+
'priority', # Nice value plus 15
|
|
47
|
+
'nice', # Nice value
|
|
48
|
+
'num_threads', # Number of threads in this process
|
|
49
|
+
'itrealvalue', # Time in jiffies before next SIGALRM
|
|
50
|
+
'starttime', # Time in jiffies since system boot
|
|
51
|
+
'vsize', # Virtual memory size in bytes
|
|
52
|
+
'rss', # Resident set size
|
|
53
|
+
'rlim', # Current limit on the rss in bytes (old)
|
|
54
|
+
'rsslim', # Current limit on the rss in bytes (current)
|
|
55
|
+
'startcode', # Address above which program text can run
|
|
56
|
+
'endcode', # Address below which program text can run
|
|
57
|
+
'startstack', # Address of the startstack
|
|
58
|
+
'kstkesp', # Kernel stack page address
|
|
59
|
+
'kstkeip', # Kernel instruction pointer
|
|
60
|
+
'signal', # Bitmap of pending signals
|
|
61
|
+
'blocked', # Bitmap of blocked signals
|
|
62
|
+
'sigignore', # Bitmap of ignored signals
|
|
63
|
+
'sigcatch', # Bitmap of caught signals
|
|
64
|
+
'wchan', # Channel in which the process is waiting
|
|
65
|
+
'nswap', # Number of pages swapped
|
|
66
|
+
'cnswap', # Cumulative nswap for child processes
|
|
67
|
+
'exit_signal', # Signal to be sent to parent when process dies
|
|
68
|
+
'processor', # CPU number last executed on
|
|
69
|
+
'rt_priority', # Real time scheduling priority
|
|
70
|
+
'policy', # Scheduling policy
|
|
71
|
+
'delayacct_blkio_ticks', # Aggregated block I/O delays
|
|
72
|
+
'guest_time', # Guest time of the process
|
|
73
|
+
'cguest_time', # Guest time of the process's children
|
|
74
|
+
'name', # Process name
|
|
75
|
+
'uid', # Real user ID
|
|
76
|
+
'euid', # Effective user ID
|
|
77
|
+
'gid', # Real group ID
|
|
78
|
+
'egid', # Effective group ID
|
|
79
|
+
'pctcpu', # Percent of CPU usage (custom field)
|
|
80
|
+
'pctmem', # Percent of Memory usage (custom field)
|
|
81
|
+
'nlwp', # Number of Light-Weight Processes associated with the process (threads)
|
|
82
|
+
'cgroup', # Control groups to which the process belongs
|
|
83
|
+
'smaps' # Process memory size for all mapped files
|
|
80
84
|
]
|
|
81
85
|
|
|
82
86
|
public
|
|
@@ -198,47 +202,51 @@ module Sys
|
|
|
198
202
|
|
|
199
203
|
stat = stat.split
|
|
200
204
|
|
|
201
|
-
struct.pid
|
|
202
|
-
struct.comm
|
|
203
|
-
struct.state
|
|
204
|
-
struct.ppid
|
|
205
|
-
struct.pgrp
|
|
206
|
-
struct.session
|
|
207
|
-
struct.tty_nr
|
|
208
|
-
struct.tpgid
|
|
209
|
-
struct.flags
|
|
210
|
-
struct.minflt
|
|
211
|
-
struct.cminflt
|
|
212
|
-
struct.majflt
|
|
213
|
-
struct.cmajflt
|
|
214
|
-
struct.utime
|
|
215
|
-
struct.stime
|
|
216
|
-
struct.cutime
|
|
217
|
-
struct.cstime
|
|
218
|
-
struct.priority
|
|
219
|
-
struct.nice
|
|
220
|
-
struct.num_threads
|
|
221
|
-
struct.itrealvalue
|
|
222
|
-
struct.starttime
|
|
223
|
-
struct.vsize
|
|
224
|
-
struct.rss
|
|
225
|
-
struct.rlim
|
|
226
|
-
struct.
|
|
227
|
-
struct.
|
|
228
|
-
struct.
|
|
229
|
-
struct.
|
|
230
|
-
struct.
|
|
231
|
-
struct.
|
|
232
|
-
struct.
|
|
233
|
-
struct.
|
|
234
|
-
struct.
|
|
235
|
-
struct.
|
|
236
|
-
struct.
|
|
237
|
-
struct.
|
|
238
|
-
struct.
|
|
239
|
-
struct.
|
|
240
|
-
struct.
|
|
241
|
-
struct.
|
|
205
|
+
struct.pid = stat[0].to_i
|
|
206
|
+
struct.comm = stat[1].tr('()','') # Remove parens
|
|
207
|
+
struct.state = stat[2]
|
|
208
|
+
struct.ppid = stat[3].to_i
|
|
209
|
+
struct.pgrp = stat[4].to_i
|
|
210
|
+
struct.session = stat[5].to_i
|
|
211
|
+
struct.tty_nr = stat[6].to_i
|
|
212
|
+
struct.tpgid = stat[7].to_i
|
|
213
|
+
struct.flags = stat[8].to_i
|
|
214
|
+
struct.minflt = stat[9].to_i
|
|
215
|
+
struct.cminflt = stat[10].to_i
|
|
216
|
+
struct.majflt = stat[11].to_i
|
|
217
|
+
struct.cmajflt = stat[12].to_i
|
|
218
|
+
struct.utime = stat[13].to_i
|
|
219
|
+
struct.stime = stat[14].to_i
|
|
220
|
+
struct.cutime = stat[15].to_i
|
|
221
|
+
struct.cstime = stat[16].to_i
|
|
222
|
+
struct.priority = stat[17].to_i
|
|
223
|
+
struct.nice = stat[18].to_i
|
|
224
|
+
struct.num_threads = stat[19].to_i
|
|
225
|
+
struct.itrealvalue = stat[20].to_i
|
|
226
|
+
struct.starttime = stat[21].to_i
|
|
227
|
+
struct.vsize = stat[22].to_i
|
|
228
|
+
struct.rss = stat[23].to_i
|
|
229
|
+
struct.rlim = stat[24].to_i # Old name for backwards compatibility
|
|
230
|
+
struct.rsslim = stat[24].to_i
|
|
231
|
+
struct.startcode = stat[25].to_i
|
|
232
|
+
struct.endcode = stat[26].to_i
|
|
233
|
+
struct.startstack = stat[27].to_i
|
|
234
|
+
struct.kstkesp = stat[28].to_i
|
|
235
|
+
struct.kstkeip = stat[29].to_i
|
|
236
|
+
struct.signal = stat[30].to_i
|
|
237
|
+
struct.blocked = stat[31].to_i
|
|
238
|
+
struct.sigignore = stat[32].to_i
|
|
239
|
+
struct.sigcatch = stat[33].to_i
|
|
240
|
+
struct.wchan = stat[34].to_i
|
|
241
|
+
struct.nswap = stat[35].to_i
|
|
242
|
+
struct.cnswap = stat[36].to_i
|
|
243
|
+
struct.exit_signal = stat[37].to_i
|
|
244
|
+
struct.processor = stat[38].to_i
|
|
245
|
+
struct.rt_priority = stat[39].to_i
|
|
246
|
+
struct.policy = stat[40].to_i
|
|
247
|
+
struct.delayacct_blkio_ticks = stat[41].to_i
|
|
248
|
+
struct.guest_time = stat[42].to_i
|
|
249
|
+
struct.cguest_time = stat[43].to_i
|
|
242
250
|
|
|
243
251
|
# Get /proc/<pid>/status information (name, uid, euid, gid, egid)
|
|
244
252
|
begin
|
|
@@ -13,9 +13,9 @@ describe Sys::ProcTable do
|
|
|
13
13
|
cmdline cwd environ exe fd root pid name uid euid gid egid comm state ppid pgrp
|
|
14
14
|
session tty_nr tpgid flags minflt cminflt majflt cmajflt utime
|
|
15
15
|
stime cutime cstime priority nice num_threads itrealvalue starttime vsize
|
|
16
|
-
rss rlim startcode endcode startstack kstkesp kstkeip signal blocked
|
|
16
|
+
rss rlim rsslim startcode endcode startstack kstkesp kstkeip signal blocked
|
|
17
17
|
sigignore sigcatch wchan nswap cnswap exit_signal processor rt_priority
|
|
18
|
-
policy pctcpu pctmem nlwp cgroup smaps
|
|
18
|
+
policy delayacct_blkio_ticks guest_time cguest_time pctcpu pctmem nlwp cgroup smaps
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -172,9 +172,10 @@ describe Sys::ProcTable do
|
|
|
172
172
|
expect(subject.rss).to be_kind_of(Numeric)
|
|
173
173
|
end
|
|
174
174
|
|
|
175
|
-
it "contains an
|
|
176
|
-
expect(subject).to respond_to(:
|
|
177
|
-
expect(subject.
|
|
175
|
+
it "contains an rsslim member and returns the expected value" do
|
|
176
|
+
expect(subject).to respond_to(:rsslim)
|
|
177
|
+
expect(subject.rsslim).to be_kind_of(Numeric)
|
|
178
|
+
expect(subject.rsslim).to eq(subject.rlim)
|
|
178
179
|
end
|
|
179
180
|
|
|
180
181
|
it "contains an startcode member and returns the expected value" do
|
|
@@ -257,6 +258,21 @@ describe Sys::ProcTable do
|
|
|
257
258
|
expect(subject.policy).to be_kind_of(Integer)
|
|
258
259
|
end
|
|
259
260
|
|
|
261
|
+
it "contains a delayacct_blkio_ticks member and returns the expected value" do
|
|
262
|
+
expect(subject).to respond_to(:delayacct_blkio_ticks)
|
|
263
|
+
expect(subject.delayacct_blkio_ticks).to be_kind_of(Integer)
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
it "contains a guest_time member and returns the expected value" do
|
|
267
|
+
expect(subject).to respond_to(:guest_time)
|
|
268
|
+
expect(subject.guest_time).to be_kind_of(Integer)
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
it "contains a cguest_time member and returns the expected value" do
|
|
272
|
+
expect(subject).to respond_to(:cguest_time)
|
|
273
|
+
expect(subject.cguest_time).to be_kind_of(Integer)
|
|
274
|
+
end
|
|
275
|
+
|
|
260
276
|
it "contains a name member and returns the expected value" do
|
|
261
277
|
expect(subject).to respond_to(:name)
|
|
262
278
|
expect(subject.name).to be_kind_of(String)
|
data/sys-proctable.gemspec
CHANGED
metadata
CHANGED
metadata.gz.sig
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
U
|
|
4
|
-
|
|
5
|
-
�0�L:��-��ћ�|��J2�+64Fk_�T�*Qxk��� ���֪Y���8�l���tj{E�o�
|
|
6
|
-
�;����Y
|
|
7
|
-
'S)!�_q���g<k�C�P����'b m_���E-�7g
|
|
1
|
+
3z�\�Iܭo���O]�#�]�]�kcO���R#mI�38+��휒�+wq�}G�dt��#�� ��l �>/�g�?|�}��:����n�Yl�M��I����j������ui}R8�:�B�(����Pu�Ԩ�OF�Tv�J�b,�����u'��T8�`����痰��٪.o��yjv|4��Qr�5���hڞQ�q�F���L��ۆ��$C�^���֙�
|
|
2
|
+
���
|
|
3
|
+
���("Rw+U��8/�z�q��{߽�ͮ!���^���B�~����
|
|
4
|
+
^�«��)������+�`ev��Q����Xy����]����_�Cd��!����,R����p��B�O����
|