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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c36a4455aa4fd0172d51e7e1e69b69c180a86da3570247c6958c2bdee34a314
4
- data.tar.gz: 2659ffc977988520db6d68703efa079815d966fd0320679c8cc961a75daf3f13
3
+ metadata.gz: 01c653a363b9c37b67d34370e882e24aefc772c95677ee7420b9601f279c2e9b
4
+ data.tar.gz: c3dbf4252b810a0abd69bdc3d401a653ae8b8e24d31d8be15fea7d5ddd37f7a3
5
5
  SHA512:
6
- metadata.gz: d2a101a16b5c3a767917fc2f4e32633f20785a9d678c46f6def07aabc3d5392238bfe8b48a73f203f607a161c1908f0e412e73f5b2a6c92a56c16c8e65c72594
7
- data.tar.gz: c372c2763018d53376e11aaaa8004071eff144dfd3830c1fb15dbfcc4f35316a2870b1519d0a77613a3465e31bcca0da9f0397dba0c1bfaf1e0e9b0649029a04
6
+ metadata.gz: 9f97e3368e08424eb1ac80dd50865f0803066de539fd93defebfb8dbd8591d44447a24a5621555b2b6e29f5f72ae33f03be2b973d3106ad87ecd1bcef67fb8eb
7
+ data.tar.gz: a17fd29c3cfc2aed02ab884467aa24f403258aa8bc9f4f9fa084892685d6898992808625e3dacc18d1616232f11ad8c2b7ac8ce21b80fdd3bd8faadb4e733791
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
@@ -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', # 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
54
- 'startcode', # Address above which program text can run
55
- 'endcode', # Address below which program text can run
56
- 'startstack', # Address of the startstack
57
- 'kstkesp', # Kernel stack page address
58
- 'kstkeip', # Kernel instruction pointer
59
- 'signal', # Bitmap of pending signals
60
- 'blocked', # Bitmap of blocked signals
61
- 'sigignore', # Bitmap of ignored signals
62
- 'sigcatch', # Bitmap of caught signals
63
- 'wchan', # Channel in which the process is waiting
64
- 'nswap', # Number of pages swapped
65
- 'cnswap', # Cumulative nswap for child processes
66
- 'exit_signal', # Signal to be sent to parent when process dies
67
- 'processor', # CPU number last executed on
68
- 'rt_priority', # Real time scheduling priority
69
- 'policy', # Scheduling policy
70
- 'name', # Process name
71
- 'uid', # Real user ID
72
- 'euid', # Effective user ID
73
- 'gid', # Real group ID
74
- 'egid', # Effective group ID
75
- 'pctcpu', # Percent of CPU usage (custom field)
76
- 'pctmem', # Percent of Memory usage (custom field)
77
- 'nlwp', # Number of Light-Weight Processes associated with the process (threads)
78
- 'cgroup', # Control groups to which the process belongs
79
- 'smaps' # Process memory size for all mapped files
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 = stat[0].to_i
202
- struct.comm = stat[1].tr('()','') # Remove parens
203
- struct.state = stat[2]
204
- struct.ppid = stat[3].to_i
205
- struct.pgrp = stat[4].to_i
206
- struct.session = stat[5].to_i
207
- struct.tty_nr = stat[6].to_i
208
- struct.tpgid = stat[7].to_i
209
- struct.flags = stat[8].to_i
210
- struct.minflt = stat[9].to_i
211
- struct.cminflt = stat[10].to_i
212
- struct.majflt = stat[11].to_i
213
- struct.cmajflt = stat[12].to_i
214
- struct.utime = stat[13].to_i
215
- struct.stime = stat[14].to_i
216
- struct.cutime = stat[15].to_i
217
- struct.cstime = stat[16].to_i
218
- struct.priority = stat[17].to_i
219
- struct.nice = stat[18].to_i
220
- struct.num_threads = stat[19].to_i
221
- struct.itrealvalue = stat[20].to_i
222
- struct.starttime = stat[21].to_i
223
- struct.vsize = stat[22].to_i
224
- struct.rss = stat[23].to_i
225
- struct.rlim = stat[24].to_i
226
- struct.startcode = stat[25].to_i
227
- struct.endcode = stat[26].to_i
228
- struct.startstack = stat[27].to_i
229
- struct.kstkesp = stat[28].to_i
230
- struct.kstkeip = stat[29].to_i
231
- struct.signal = stat[30].to_i
232
- struct.blocked = stat[31].to_i
233
- struct.sigignore = stat[32].to_i
234
- struct.sigcatch = stat[33].to_i
235
- struct.wchan = stat[34].to_i
236
- struct.nswap = stat[35].to_i
237
- struct.cnswap = stat[36].to_i
238
- struct.exit_signal = stat[37].to_i
239
- struct.processor = stat[38].to_i
240
- struct.rt_priority = stat[39].to_i
241
- struct.policy = stat[40].to_i
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
@@ -1,6 +1,6 @@
1
1
  module Sys
2
2
  class ProcTable
3
3
  # The version of the sys-proctable library
4
- VERSION = '1.2.4'.freeze
4
+ VERSION = '1.2.5'.freeze
5
5
  end
6
6
  end
@@ -16,7 +16,7 @@ describe Sys::ProcTable do
16
16
  end
17
17
 
18
18
  it "has a VERSION constant set to the expected value" do
19
- expect(Sys::ProcTable::VERSION).to eql('1.2.4')
19
+ expect(Sys::ProcTable::VERSION).to eql('1.2.5')
20
20
  expect(Sys::ProcTable::VERSION).to be_frozen
21
21
  end
22
22
 
@@ -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 rlim member and returns the expected value" do
176
- expect(subject).to respond_to(:rlim)
177
- expect(subject.rlim).to be_kind_of(Numeric)
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)
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'sys-proctable'
5
- spec.version = '1.2.4'
5
+ spec.version = '1.2.5'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.license = 'Apache-2.0'
8
8
  spec.email = 'djberg96@gmail.com'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys-proctable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
metadata.gz.sig CHANGED
@@ -1,7 +1,4 @@
1
- ������s���r���k��S�P�܁�&����%J0h�@�����h"�ۤ
2
- ����LJ<��=�.����H)&�� �/ۈ�j����}��L���&S+�|)Y����$��h7�
3
- U��4m
4
- �;��19��Wު�c@;�uc���s2``#�F�K!\Ӓ��%��p�[�Y�R/9CX�G�0x����I�2< �9ES��������?{C��ߵ����T�׏`��)��pq�*�G��v')�$��?���$�� &,��
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��BO����