sys-proctable 0.9.5-universal-linux → 0.9.6-universal-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +3 -0
- data/README +8 -1
- data/lib/linux/sys/proctable.rb +8 -3
- data/sys-proctable.gemspec +1 -1
- data/test/test_sys_proctable_all.rb +1 -1
- data/test/test_sys_proctable_linux.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6acee7cc47351454fd011763cc450bc245553ed5
|
4
|
+
data.tar.gz: 932bcdd1ef0b3f2ed44c24ca5ca8379c9a8f8abb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60bc5d1992a2b9902d439a38301741b42f26f97b05a2fe1d735986fa0b6225c9f5d8ddc84a994e55390631ce0ba98d51beb31f954c6d3aad2e08389d2688110d
|
7
|
+
data.tar.gz: 64cda85c92b65f607ee85ab863f8ba3c5fd416b1724ae20099d4e2a71e61ea70d42a913ae92910ad60072f2722a59f8c7cb1e6eeed6bb5b97866f59b4d9b6a1f
|
data/CHANGES
CHANGED
data/README
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
* Solaris 8+
|
12
12
|
* HP-UX 10+
|
13
13
|
* OS X 10.4+
|
14
|
+
* AIX 5.3+
|
14
15
|
|
15
16
|
== Installation
|
16
17
|
gem install sys-proctable
|
@@ -104,8 +105,14 @@
|
|
104
105
|
Artistic 2.0
|
105
106
|
|
106
107
|
== Copyright
|
107
|
-
(C) 2003-
|
108
|
+
(C) 2003-2015 Daniel J. Berger
|
108
109
|
All Rights Reserved.
|
109
110
|
|
111
|
+
== Contributions
|
112
|
+
Although this library is free, please consider having your company
|
113
|
+
setup a gittip if used by your company professionally.
|
114
|
+
|
115
|
+
http://www.gittip.com/djberg96/
|
116
|
+
|
110
117
|
== Author
|
111
118
|
Daniel J. Berger
|
data/lib/linux/sys/proctable.rb
CHANGED
@@ -11,7 +11,7 @@ module Sys
|
|
11
11
|
private_class_method :new
|
12
12
|
|
13
13
|
# The version of the sys-proctable library
|
14
|
-
VERSION = '0.9.
|
14
|
+
VERSION = '0.9.6'
|
15
15
|
|
16
16
|
private
|
17
17
|
|
@@ -70,8 +70,9 @@ module Sys
|
|
70
70
|
'euid', # Effective user ID
|
71
71
|
'gid', # Real group ID
|
72
72
|
'egid', # Effective group ID
|
73
|
-
'pctcpu',
|
74
|
-
'pctmem' # Percent of Memory usage (custom field)
|
73
|
+
'pctcpu', # Percent of CPU usage (custom field)
|
74
|
+
'pctmem', # Percent of Memory usage (custom field)
|
75
|
+
'nlwp' # Number of Light-Weight Processes associated with the process (threads)
|
75
76
|
]
|
76
77
|
|
77
78
|
public
|
@@ -160,6 +161,10 @@ module Sys
|
|
160
161
|
# Get /proc/<pid>/stat information
|
161
162
|
stat = IO.read("/proc/#{file}/stat") rescue next
|
162
163
|
|
164
|
+
# Get number of LWP, one directory for each in /proc/<pid>/task/
|
165
|
+
# Every process has at least one thread, so if we fail to read the task directory, set nlwp to 1.
|
166
|
+
struct.nlwp = Dir.glob("/proc/#{file}/task/*").length rescue struct.nlwp = 1
|
167
|
+
|
163
168
|
# Deal with spaces in comm name. Courtesy of Ara Howard.
|
164
169
|
re = %r/\([^\)]+\)/
|
165
170
|
comm = stat[re]
|
data/sys-proctable.gemspec
CHANGED
@@ -17,7 +17,7 @@ class TC_ProcTable_Linux < Test::Unit::TestCase
|
|
17
17
|
stime cutime cstime priority nice itrealvalue starttime vsize
|
18
18
|
rss rlim startcode endcode startstack kstkesp kstkeip signal blocked
|
19
19
|
sigignore sigcatch wchan nswap cnswap exit_signal processor environ
|
20
|
-
pctcpu pctmem
|
20
|
+
pctcpu pctmem nlwp
|
21
21
|
/
|
22
22
|
end
|
23
23
|
|
@@ -290,6 +290,11 @@ class TC_ProcTable_Linux < Test::Unit::TestCase
|
|
290
290
|
assert_kind_of(Float, @ptable.pctcpu)
|
291
291
|
end
|
292
292
|
|
293
|
+
def test_nlwp
|
294
|
+
assert_respond_to(@ptable, :nlwp)
|
295
|
+
assert_kind_of(Fixnum, @ptable.nlwp)
|
296
|
+
end
|
297
|
+
|
293
298
|
def teardown
|
294
299
|
@ptable = nil
|
295
300
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-proctable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: universal-linux
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|