sys-proctable 1.2.0 → 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.
@@ -10,12 +10,12 @@ require_relative 'sys_proctable_all_spec'
10
10
 
11
11
  describe Sys::ProcTable do
12
12
  let(:fields){ %w[
13
- cmdline cwd exe pid name uid euid gid egid comm state ppid pgrp
14
- session tty_num tpgid flags minflt cminflt majflt cmajflt utime
15
- stime cutime cstime priority nice itrealvalue starttime vsize
16
- rss rlim startcode endcode startstack kstkesp kstkeip signal blocked
17
- sigignore sigcatch wchan nswap cnswap exit_signal processor environ
18
- pctcpu pctmem nlwp cgroup smaps
13
+ cmdline cwd environ exe fd root pid name uid euid gid egid comm state ppid pgrp
14
+ session tty_nr tpgid flags minflt cminflt majflt cmajflt utime
15
+ stime cutime cstime priority nice num_threads itrealvalue starttime vsize
16
+ rss rlim rsslim startcode endcode startstack kstkesp kstkeip signal blocked
17
+ sigignore sigcatch wchan nswap cnswap exit_signal processor rt_priority
18
+ policy delayacct_blkio_ticks guest_time cguest_time pctcpu pctmem nlwp cgroup smaps
19
19
  ]
20
20
  }
21
21
 
@@ -147,6 +147,11 @@ describe Sys::ProcTable do
147
147
  expect(subject.nice).to be_kind_of(Numeric)
148
148
  end
149
149
 
150
+ it "contains a num_threads member and returns the expected value" do
151
+ expect(subject).to respond_to(:num_threads)
152
+ expect(subject.num_threads).to be_kind_of(Numeric)
153
+ end
154
+
150
155
  it "contains a itrealvalue member and returns the expected value" do
151
156
  expect(subject).to respond_to(:itrealvalue)
152
157
  expect(subject.itrealvalue).to be_kind_of(Numeric)
@@ -167,9 +172,10 @@ describe Sys::ProcTable do
167
172
  expect(subject.rss).to be_kind_of(Numeric)
168
173
  end
169
174
 
170
- it "contains an rlim member and returns the expected value" do
171
- expect(subject).to respond_to(:rlim)
172
- 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)
173
179
  end
174
180
 
175
181
  it "contains an startcode member and returns the expected value" do
@@ -252,6 +258,21 @@ describe Sys::ProcTable do
252
258
  expect(subject.policy).to be_kind_of(Integer)
253
259
  end
254
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
+
255
276
  it "contains a name member and returns the expected value" do
256
277
  expect(subject).to respond_to(:name)
257
278
  expect(subject.name).to be_kind_of(String)
@@ -307,4 +328,12 @@ describe Sys::ProcTable do
307
328
  expect(subject.smaps).to be_kind_of(Sys::ProcTable::Smaps)
308
329
  end
309
330
  end
331
+
332
+ context "fields" do
333
+ it "has a fields method that returns the expected results" do
334
+ expect(described_class).to respond_to(:fields)
335
+ expect(described_class.fields).to be_kind_of(Array)
336
+ expect(described_class.fields).to match_array(fields)
337
+ end
338
+ end
310
339
  end
@@ -2,9 +2,9 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'sys-proctable'
5
- spec.version = '1.2.0'
5
+ spec.version = '1.2.5'
6
6
  spec.author = 'Daniel J. Berger'
7
- spec.license = 'Apache 2.0'
7
+ spec.license = 'Apache-2.0'
8
8
  spec.email = 'djberg96@gmail.com'
9
9
  spec.homepage = 'http://github.com/djberg96/sys-proctable'
10
10
  spec.summary = 'An interface for providing process table information'
@@ -15,19 +15,29 @@ Gem::Specification.new do |spec|
15
15
  "benchmarks/**/*.rb",
16
16
  "examples/**/*.rb",
17
17
  "lib/**/*.rb",
18
- 'CHANGES',
19
- 'MANIFEST',
18
+ 'CHANGES.rdoc',
19
+ 'LICENSE',
20
+ 'MANIFEST.rdoc',
20
21
  'Rakefile',
21
- 'README',
22
+ 'README.md',
22
23
  'sys-proctable.gemspec'
23
24
  ]
24
25
 
25
- spec.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST', 'doc/top.txt']
26
+ spec.extra_rdoc_files = ['CHANGES.rdoc', 'README.md', 'MANIFEST.rdoc']
26
27
 
27
28
  spec.add_dependency('ffi')
28
29
  spec.add_development_dependency('rspec')
29
30
  spec.add_development_dependency('rake')
30
31
 
32
+ spec.metadata = {
33
+ 'homepage_uri' => 'https://github.com/djberg96/sys-proctable',
34
+ 'bug_tracker_uri' => 'https://github.com/djberg96/sys-proctable/issues',
35
+ 'changelog_uri' => 'https://github.com/djberg96/sys-proctable/blob/master/CHANGES.rdoc',
36
+ 'documentation_uri' => 'https://github.com/djberg96/sys-proctable/wiki',
37
+ 'source_code_uri' => 'https://github.com/djberg96/sys-proctable',
38
+ 'wiki_uri' => 'https://github.com/djberg96/sys-proctable/wiki'
39
+ }
40
+
31
41
  spec.description = <<-EOF
32
42
  The sys-proctable library provides an interface for gathering information
33
43
  about processes on your system, i.e. the process table. Most major
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.0
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -12,30 +12,30 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
14
14
  cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
15
- MB4XDTE4MDIxOTIzMjIxMloXDTI4MDIxNz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IEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
27
+ AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
28
+ YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
29
+ /3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
30
+ h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
31
+ 6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
32
+ ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
33
+ 1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
34
+ DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
35
+ ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
+ WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date: 2018-02-20 00:00:00.000000000 Z
38
+ date:
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ffi
@@ -89,11 +89,11 @@ email: djberg96@gmail.com
89
89
  executables: []
90
90
  extensions: []
91
91
  extra_rdoc_files:
92
- - CHANGES
93
- - README
94
- - MANIFEST
95
- - doc/top.txt
92
+ - CHANGES.rdoc
93
+ - README.md
94
+ - MANIFEST.rdoc
96
95
  files:
96
+ - benchmarks/bench_ips_ps.rb
97
97
  - benchmarks/bench_ps.rb
98
98
  - examples/example_ps.rb
99
99
  - lib/aix/sys/proctable.rb
@@ -109,15 +109,22 @@ files:
109
109
  - lib/sys/proctable/version.rb
110
110
  - lib/sys/top.rb
111
111
  - lib/windows/sys/proctable.rb
112
- - CHANGES
113
- - MANIFEST
112
+ - CHANGES.rdoc
113
+ - LICENSE
114
+ - MANIFEST.rdoc
114
115
  - Rakefile
115
- - README
116
+ - README.md
116
117
  - sys-proctable.gemspec
117
118
  homepage: http://github.com/djberg96/sys-proctable
118
119
  licenses:
119
- - Apache 2.0
120
- metadata: {}
120
+ - Apache-2.0
121
+ metadata:
122
+ homepage_uri: https://github.com/djberg96/sys-proctable
123
+ bug_tracker_uri: https://github.com/djberg96/sys-proctable/issues
124
+ changelog_uri: https://github.com/djberg96/sys-proctable/blob/master/CHANGES.rdoc
125
+ documentation_uri: https://github.com/djberg96/sys-proctable/wiki
126
+ source_code_uri: https://github.com/djberg96/sys-proctable
127
+ wiki_uri: https://github.com/djberg96/sys-proctable/wiki
121
128
  post_install_message:
122
129
  rdoc_options: []
123
130
  require_paths:
@@ -133,12 +140,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
140
  - !ruby/object:Gem::Version
134
141
  version: '0'
135
142
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.6.11
143
+ rubygems_version: 3.0.6
138
144
  signing_key:
139
145
  specification_version: 4
140
146
  summary: An interface for providing process table information
141
147
  test_files:
148
+ - spec/spec_helper.rb
142
149
  - spec/sys_proctable_aix_spec.rb
143
150
  - spec/sys_proctable_all_spec.rb
144
151
  - spec/sys_proctable_darwin_spec.rb
metadata.gz.sig CHANGED
Binary file
data/README DELETED
@@ -1,120 +0,0 @@
1
- == Description
2
- A Ruby interface for gathering process information.
3
-
4
- == Prerequisites
5
- * Test::Unit 2.x (development only)
6
-
7
- == Supported Platforms
8
- * Windows 2000 or later
9
- * Linux 2.6+
10
- * FreeBSD
11
- * Solaris 8+
12
- * HP-UX 10+
13
- * OS X 10.7+
14
- * AIX 5.3+
15
-
16
- == Installation
17
- gem install sys-proctable
18
-
19
- You may need to specify a platform in some cases. For example:
20
-
21
- gem install sys-proctable --platform mswin32 # Windows
22
- gem install sys-proctable --platform sunos # Solaris
23
- gem install sys-proctable --platform linux # Linux
24
- gem install sys-proctable --platform freebsd # FreeBSD
25
- gem install sys-proctable --platform darwin # OS X
26
-
27
- == Synopsis
28
- require 'sys/proctable'
29
- include Sys
30
-
31
- # Everything
32
- ProcTable.ps{ |p|
33
- puts p.pid.to_s
34
- puts p.comm
35
- # ...
36
- }
37
-
38
- # Just one process
39
- s = ProcTable.ps(2123)
40
- puts s.pid.to_s
41
- puts s.comm
42
- # ...
43
-
44
- # Return the results as an array of ProcTableStructs
45
- a = ProcTable.ps
46
- a.each do |p|
47
- puts p.pid
48
- # ...
49
- end
50
-
51
- == Notes
52
- Windows users may pass a host name as a second argument to get process
53
- information from a different host. This relies on the WMI service running.
54
-
55
- == Known Issues
56
- === FreeBSD
57
- A kvm interface is used. That means the owner of the process using the
58
- sys-proctable library needs to be a member of the kvm group (or root).
59
-
60
- === Bundler
61
- Bundler seems to have trouble installing the proper gem because of the
62
- platform specific gem names. To deal with that, run this command first:
63
-
64
- bundle config specific_platform true
65
-
66
- You can follow the issue at:
67
-
68
- https://github.com/bundler/bundler/issues/5536
69
-
70
- === Solaris
71
- The cmdline member on Solaris is limited to 80 characters unless you (or
72
- your program) own the process. This is a Solaris design flaw/feature.
73
-
74
- === OS X
75
- The libproc interface is used. That means you will only get list of
76
- processes that you have access to. To get a full listing, run as root.
77
-
78
- == Future Plans
79
- Add support for NetBSD and OpenBSD.
80
- Convert remaining C code (just HP-UX at this point) to FFI.
81
-
82
- == Acknowledgements
83
- This library was originally based on the Perl module Proc::ProcessTable
84
- by Dan Urist. Many ideas, as well as large chunks of code, were taken
85
- from his work. So, a big THANK YOU goes out to Dan Urist.
86
-
87
- A big thanks also goes out to Mike Hall who was very helpful with ideas,
88
- logic and testing.
89
-
90
- Thanks also go to Sean Chittenden for providing an account on one of his
91
- FreeBSD machines. This is how the FreeBSD support was (initially) added.
92
-
93
- Thanks go to James Hranicky for providing a patch that grabs name, eid,
94
- euid, gid and guid info in the Linux version, along with some general
95
- debugging help.
96
-
97
- Thanks go to David Felstead for the original OS X code. Thanks also go
98
- to Matthias Zirnstein for adding the original cmdline support for OS X.
99
-
100
- Finally I'd like to thank all the folks who have submitted bug reports
101
- and/or patches.
102
-
103
- == Help Wanted
104
- I do not have access to all platforms. If your platform is not supported
105
- then you will need to either submit a patch or give me a remote account
106
- on a box with a compiler so that I can write the code.
107
-
108
- == More documentation
109
- See the documentation under the 'doc' directory for more information,
110
- including platform specific notes and issues.
111
-
112
- == License
113
- Apache 2.0
114
-
115
- == Copyright
116
- (C) 2003-2016 Daniel J. Berger
117
- All Rights Reserved.
118
-
119
- == Author
120
- Daniel J. Berger
@@ -1,47 +0,0 @@
1
- = Description
2
- A simple 'top' interface for Ruby
3
-
4
- = Prerequisites
5
- Requires the "sys/proctable" package (which should be installed along
6
- with this package).
7
-
8
- = Synopsis
9
- require "sys/top"
10
-
11
- Sys::Top.top(5).each{ |ps|
12
- p ps
13
- }
14
-
15
- = Constants
16
- VERSION
17
- Returns the version number of this package as a String.
18
-
19
- = Class Methods
20
- Sys::Top.top(number=10, field="pctcpu")
21
- Returns an array of ProcTableStruct's. The size of the array (i.e. the
22
- number of processes) that it returns is based on +number+, and sorted by
23
- +pctcpu+. By default, the size and field values are 10 and "pctcpu",
24
- respectively.
25
-
26
- = Notes
27
- Not all fields are available on all platforms. Please check your
28
- platform specific documentation for which fields are available.
29
-
30
- = Bugs
31
- None that I'm aware of. Please log bug reports on the project page at
32
- http://www.rubyforge.org/projects/sysutils
33
-
34
- = License
35
- Artistic 2.0
36
-
37
- = Copyright
38
- (C) 2004-2009 Daniel J. Berger
39
- All Rights Reserved.
40
-
41
- = Warranty
42
- This package is provided "as is" and without any express or
43
- implied warranties, including, without limitation, the implied
44
- warranties of merchantability and fitness for a particular purpose.
45
-
46
- = Author
47
- Daniel J. Berger