sys-cpu 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +6 -0
- data/Rakefile +1 -1
- data/certs/djberg96_pub.pem +22 -17
- data/lib/sys/cpu.rb +4 -4
- data/lib/sys/linux/sys/cpu.rb +19 -3
- data/sys-cpu.gemspec +3 -3
- data/test/test_sys_cpu_version.rb +5 -1
- metadata +44 -27
- metadata.gz.sig +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: de4fef13495a9b0d229eea6796851de82b4ccadc4a8e45dcea91b42d9f6ec074
|
4
|
+
data.tar.gz: 6da5868da52f3237d14d42a9a8823292711687957da05bda73136e7936f6946d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07ec871287015c0bb7ab832e7c679156e83d26a48eb78d27258799c301c3e33626496eb6519efe487f206bb3e2239845ba1a405b4050847f2b7099f9d9f79eec
|
7
|
+
data.tar.gz: dfaa9832d07510d6bea73c8a775404362fa09c3fe945e88331d0486e7be707db0bd756c128350fac4d9fcbf668b3f0e54fca3f295df2f940d93e974684bf530a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 0.8.0 - 17-Oct-2018
|
2
|
+
* Switched license to Apache 2.0.
|
3
|
+
* Updated documentation for the cpu_stats method on Linux.
|
4
|
+
* The VERSION constant is now frozen.
|
5
|
+
* Now uses require_relative internally where needed.
|
6
|
+
|
1
7
|
== 0.7.2 - 5-Sep-2015
|
2
8
|
* Replaced a global array with a constant in the Linux version. Thanks go
|
3
9
|
to Yorick Peterse for the patch.
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ namespace 'gem' do
|
|
12
12
|
require 'rubygems/package'
|
13
13
|
spec = eval(IO.read('sys-cpu.gemspec'))
|
14
14
|
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
|
15
|
-
Gem::Package.build(spec)
|
15
|
+
Gem::Package.build(spec, true)
|
16
16
|
end
|
17
17
|
|
18
18
|
desc "Install the sys-cpu gem"
|
data/certs/djberg96_pub.pem
CHANGED
@@ -1,21 +1,26 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
2
|
+
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
|
3
3
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
4
|
-
|
4
|
+
MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
|
5
5
|
ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
6
|
+
bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
|
7
|
+
A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
|
8
|
+
u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
|
9
|
+
75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
|
10
|
+
6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskf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Dkqq7hGaiHpwKY76wQ1+8xAh
|
21
26
|
-----END CERTIFICATE-----
|
data/lib/sys/cpu.rb
CHANGED
@@ -5,15 +5,15 @@ require 'rbconfig'
|
|
5
5
|
module Sys
|
6
6
|
class CPU
|
7
7
|
# The version of the sys-cpu gem.
|
8
|
-
VERSION = '0.
|
8
|
+
VERSION = '0.8.0'.freeze
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
case RbConfig::CONFIG['host_os']
|
13
13
|
when /linux/i
|
14
|
-
|
14
|
+
require_relative('linux/sys/cpu')
|
15
15
|
when /windows|mswin|mingw|cygwin|dos/i
|
16
|
-
|
16
|
+
require_relative('windows/sys/cpu')
|
17
17
|
else
|
18
|
-
|
18
|
+
require_relative('unix/sys/cpu')
|
19
19
|
end
|
data/lib/sys/linux/sys/cpu.rb
CHANGED
@@ -5,6 +5,8 @@ module Sys
|
|
5
5
|
|
6
6
|
# :stopdoc:
|
7
7
|
|
8
|
+
private
|
9
|
+
|
8
10
|
cpu_file = "/proc/cpuinfo"
|
9
11
|
cpu_hash = {}
|
10
12
|
CPU_ARRAY = []
|
@@ -37,6 +39,8 @@ module Sys
|
|
37
39
|
|
38
40
|
CPU_ARRAY.push(cpu_hash)
|
39
41
|
|
42
|
+
public
|
43
|
+
|
40
44
|
# :startdoc:
|
41
45
|
|
42
46
|
class CPU
|
@@ -89,9 +93,21 @@ module Sys
|
|
89
93
|
IO.readlines(load_avg_file).first.split[0..2].map{ |e| e.to_f }
|
90
94
|
end
|
91
95
|
|
92
|
-
# Returns a hash of arrays that
|
93
|
-
#
|
94
|
-
#
|
96
|
+
# Returns a hash of arrays that contains an array of the following
|
97
|
+
# information (as of 2.6.33), respectively:
|
98
|
+
#
|
99
|
+
# * user: time spent in user mode.
|
100
|
+
# * nice: time spent in user mode with low priority.
|
101
|
+
# * system: time spent in system mode.
|
102
|
+
# * idle: time spent in the idle task.
|
103
|
+
# * iowait: time waiting for IO to complete.
|
104
|
+
# * irq: time servicing interrupts.
|
105
|
+
# * softirq: time servicing softirqs.
|
106
|
+
# * steal: time spent in other operating systems when running in a virtualized environment.
|
107
|
+
# * guest: time spent running a virtual CPU for guest operating systems.
|
108
|
+
# * guest_nice: time spent running a niced guest, i.e a virtual CPU for guest operating systems.
|
109
|
+
#
|
110
|
+
# Note that older kernels may not necessarily include some of these fields.
|
95
111
|
#
|
96
112
|
def self.cpu_stats
|
97
113
|
cpu_stat_file = "/proc/stat"
|
data/sys-cpu.gemspec
CHANGED
@@ -2,10 +2,10 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'sys-cpu'
|
5
|
-
spec.version = '0.
|
5
|
+
spec.version = '0.8.0'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
|
-
spec.email = 'djberg96
|
8
|
-
spec.license = '
|
7
|
+
spec.email = 'djberg96@gmail.com'
|
8
|
+
spec.license = 'Apache 2.0'
|
9
9
|
spec.homepage = 'https://github.com/djberg96/sys-cpu'
|
10
10
|
spec.summary = 'A Ruby interface for providing CPU information'
|
11
11
|
spec.test_file = 'test/test_sys_cpu.rb'
|
@@ -10,6 +10,10 @@ require 'test-unit'
|
|
10
10
|
|
11
11
|
class TC_Sys_CPU_VERSION < Test::Unit::TestCase
|
12
12
|
test "version number is set to the expected value" do
|
13
|
-
assert_equal('0.
|
13
|
+
assert_equal('0.8.0', Sys::CPU::VERSION)
|
14
|
+
end
|
15
|
+
|
16
|
+
test "version number is frozen" do
|
17
|
+
assert_true(Sys::CPU::VERSION.frozen?)
|
14
18
|
end
|
15
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-cpu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -10,27 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
|
14
14
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
-
|
15
|
+
MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
|
16
16
|
ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
17
|
+
bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
|
18
|
+
A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
|
19
|
+
u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
|
20
|
+
75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
|
21
|
+
6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
|
22
|
+
iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
|
23
|
+
ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
|
24
|
+
74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
|
25
|
+
058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
|
26
|
+
HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
|
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
|
32
37
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
38
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
34
39
|
dependencies:
|
35
40
|
- !ruby/object:Gem::Dependency
|
36
41
|
name: ffi
|
@@ -78,7 +83,7 @@ description: |2
|
|
78
83
|
The sys-cpu library provides an interface for gathering information
|
79
84
|
about your system's processor(s). Information includes speed, type,
|
80
85
|
and load average.
|
81
|
-
email: djberg96
|
86
|
+
email: djberg96@gmail.com
|
82
87
|
executables: []
|
83
88
|
extensions: []
|
84
89
|
extra_rdoc_files:
|
@@ -86,28 +91,40 @@ extra_rdoc_files:
|
|
86
91
|
- README
|
87
92
|
- MANIFEST
|
88
93
|
files:
|
89
|
-
-
|
90
|
-
- MANIFEST
|
91
|
-
- README
|
92
|
-
- Rakefile
|
94
|
+
- certs
|
93
95
|
- certs/djberg96_pub.pem
|
96
|
+
- CHANGES
|
97
|
+
- doc
|
94
98
|
- doc/bsd.txt
|
95
99
|
- doc/hpux.txt
|
96
100
|
- doc/linux.txt
|
97
101
|
- doc/sunos.txt
|
98
102
|
- doc/windows.txt
|
103
|
+
- examples
|
99
104
|
- examples/example_sys_cpu_bsd.rb
|
100
105
|
- examples/example_sys_cpu_hpux.rb
|
101
106
|
- examples/example_sys_cpu_linux.rb
|
102
107
|
- examples/example_sys_cpu_sunos.rb
|
103
108
|
- examples/example_sys_cpu_windows.rb
|
104
109
|
- install.rb
|
105
|
-
- lib
|
110
|
+
- lib
|
111
|
+
- lib/sys
|
106
112
|
- lib/sys/cpu.rb
|
113
|
+
- lib/sys/linux
|
114
|
+
- lib/sys/linux/sys
|
107
115
|
- lib/sys/linux/sys/cpu.rb
|
116
|
+
- lib/sys/unix
|
117
|
+
- lib/sys/unix/sys
|
108
118
|
- lib/sys/unix/sys/cpu.rb
|
119
|
+
- lib/sys/windows
|
120
|
+
- lib/sys/windows/sys
|
109
121
|
- lib/sys/windows/sys/cpu.rb
|
122
|
+
- lib/sys-cpu.rb
|
123
|
+
- MANIFEST
|
124
|
+
- Rakefile
|
125
|
+
- README
|
110
126
|
- sys-cpu.gemspec
|
127
|
+
- test
|
111
128
|
- test/test_sys_cpu.rb
|
112
129
|
- test/test_sys_cpu_bsd.rb
|
113
130
|
- test/test_sys_cpu_hpux.rb
|
@@ -117,7 +134,7 @@ files:
|
|
117
134
|
- test/test_sys_cpu_windows.rb
|
118
135
|
homepage: https://github.com/djberg96/sys-cpu
|
119
136
|
licenses:
|
120
|
-
-
|
137
|
+
- Apache 2.0
|
121
138
|
metadata: {}
|
122
139
|
post_install_message:
|
123
140
|
rdoc_options: []
|
@@ -135,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
152
|
version: '0'
|
136
153
|
requirements: []
|
137
154
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.7.6
|
139
156
|
signing_key:
|
140
157
|
specification_version: 4
|
141
158
|
summary: A Ruby interface for providing CPU information
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
8H�*� f*&I��F|��E-��裭�N`�qV��@�B����������,�E
|
2
|
+
m"cW��7�����sn�F�M�� K�-�J����>�v��bCD 0�E���-lо~g�#�˂�B*C+��A�t6���j�P'����[�ٚ 8Ӵ�ٴ�������A�J�3��MC�)��}H�&Pm뺓����W!�����e�1�O�F ���!�w_�k��q��ƫ5 /����x7�q���
|
3
|
+
�RB��>V����B�5V���ph����1�)��P��{��?����'6��w[1Jw���$�bv$c��m��MA
|
4
|
+
3���]�@�C�V")��Y�lE �G������ٞP��=G`V�/8WE�����x�c;������o�E��
|