sys-cpu 0.8.1 → 0.8.2
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 → CHANGES.rdoc} +4 -0
- data/{MANIFEST → MANIFEST.rdoc} +3 -3
- data/README.rdoc +75 -0
- data/lib/sys/cpu.rb +1 -1
- data/sys-cpu.gemspec +2 -2
- data/test/test_sys_cpu_version.rb +1 -1
- metadata +21 -21
- metadata.gz.sig +0 -0
- data/README +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 204a857e1da67ff544e124e88c0e94d45381f1e83bc2f2ead79d87f337e7286c
|
4
|
+
data.tar.gz: d39b0686af6c00617a39bd1591e3157f229a846981ce7d972ac38e30f605c756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b1fe1e9231fd1357d18412b6cdf203160db830d01c3c2bf3ff11b1ee321967fb6b8c7ece8744b5cde5433a035bda4ab808d90abc6b9d6f8a47f50c692987ac2
|
7
|
+
data.tar.gz: 911e6984160e4303ffe6da647970da124e58c1745424a61c6944c98d90bd8588a48ac53eec1006b06db646f56fd34e497017a179a8ef3e1f374b2aeb71e77bd0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/{CHANGES → CHANGES.rdoc}
RENAMED
data/{MANIFEST → MANIFEST.rdoc}
RENAMED
data/README.rdoc
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
= Description
|
2
|
+
A Ruby interface for getting cpu information.
|
3
|
+
|
4
|
+
= Installation
|
5
|
+
gem install sys-cpu
|
6
|
+
|
7
|
+
= Adding the trusted cert
|
8
|
+
gem cert --add <(curl -Ls https://raw.githubusercontent.com/djberg96/sys-cpu/ffi/certs/djberg96_pub.pem)
|
9
|
+
|
10
|
+
= Notes
|
11
|
+
== Solaris
|
12
|
+
Currently there is no +processors+ iterative method for multi-cpu systems.
|
13
|
+
I plan to add it this in a future release.
|
14
|
+
|
15
|
+
== OS X
|
16
|
+
The CPU.model method returns very limited information. I do not yet know
|
17
|
+
how to get more detailed information.
|
18
|
+
|
19
|
+
== Linux
|
20
|
+
This is pure Ruby. This version reads information out of /proc/cpuinfo and
|
21
|
+
/proc/loadavg, so if /proc isn't mounted it won't work.
|
22
|
+
|
23
|
+
The key-value information in /proc/cpuinfo is stored internally (i.e. in
|
24
|
+
memory) as an array of hashes when you first +require+ this package. This
|
25
|
+
overhead is exceptionally minimal, given that your average cpuinfo file
|
26
|
+
contains less than 1k of text (and I don't store whitespace or newlines).
|
27
|
+
|
28
|
+
The text documentation for Linux is dynamically generated during the
|
29
|
+
build process because the fields vary depending on your setup. So, don't
|
30
|
+
look at it until *after* you've installed it. You will see a doc/linux.txt
|
31
|
+
file after you run +rake install+ (via install.rb).
|
32
|
+
|
33
|
+
== HP-UX
|
34
|
+
Unlike other platforms, you can get load averages for an individual cpu in
|
35
|
+
multi-cpu systems. See documentation for more details.
|
36
|
+
|
37
|
+
Note that version 0.7.x and later will not work on HP-UX because of the
|
38
|
+
switch to FFI and the lack of a testing platform. However, version 0.6.x
|
39
|
+
will work just fine.
|
40
|
+
|
41
|
+
== MS Windows
|
42
|
+
This is a pure Ruby implementation using the win32ole package + WMI. The C
|
43
|
+
version has been scrapped.
|
44
|
+
|
45
|
+
As of version 0.5.0, the CPU.usage method has been removed in favor of the
|
46
|
+
CPU.load_avg method. This does not (currently) use a perf counter, so there
|
47
|
+
is no longer any delay. Also, the +processors+ method has been added and the
|
48
|
+
+supported+ method has been dropped. See the documentation for other changes.
|
49
|
+
|
50
|
+
= Acknowledgements
|
51
|
+
Thanks go to the MPlayer team for some source code that helped me on
|
52
|
+
certain versions of FreeBSD in the original C version.
|
53
|
+
|
54
|
+
= Known Bugs
|
55
|
+
None that I'm aware of. Please report bugs on the project page at:
|
56
|
+
|
57
|
+
https://github.com/djberg96/sys-cpu
|
58
|
+
|
59
|
+
= Future Plans
|
60
|
+
* Add iterative CPU.processors method.
|
61
|
+
* Add more information in general, such as what +prtdiag+ shows.
|
62
|
+
|
63
|
+
= License
|
64
|
+
Apache-2.0
|
65
|
+
|
66
|
+
= Copyright
|
67
|
+
(C) 2003-2020 Daniel J. Berger, All Rights Reserved
|
68
|
+
|
69
|
+
= Warranty
|
70
|
+
This package is provided "as is" and without any express or
|
71
|
+
implied warranties, including, without limitation, the implied
|
72
|
+
warranties of merchantability and fitness for a particular purpose.
|
73
|
+
|
74
|
+
= Author
|
75
|
+
Daniel J. Berger
|
data/lib/sys/cpu.rb
CHANGED
data/sys-cpu.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'sys-cpu'
|
5
|
-
spec.version = '0.8.
|
5
|
+
spec.version = '0.8.2'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
7
|
spec.email = 'djberg96@gmail.com'
|
8
8
|
spec.license = 'Apache-2.0'
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
spec.cert_chain = ['certs/djberg96_pub.pem']
|
14
14
|
|
15
|
-
spec.extra_rdoc_files
|
15
|
+
spec.extra_rdoc_files = Dir['*.rdoc']
|
16
16
|
|
17
17
|
# The ffi dependency is only relevent for the Unix version. Given the
|
18
18
|
# ubiquity of ffi these days, I felt a bogus dependency on ffi for Windows
|
@@ -10,7 +10,7 @@ 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.8.
|
13
|
+
assert_equal('0.8.2', Sys::CPU::VERSION)
|
14
14
|
end
|
15
15
|
|
16
16
|
test "version number is frozen" do
|
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.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -87,51 +87,51 @@ email: djberg96@gmail.com
|
|
87
87
|
executables: []
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files:
|
90
|
-
- CHANGES
|
91
|
-
-
|
92
|
-
-
|
90
|
+
- CHANGES.rdoc
|
91
|
+
- MANIFEST.rdoc
|
92
|
+
- README.rdoc
|
93
93
|
files:
|
94
|
-
- CHANGES
|
95
94
|
- test
|
96
|
-
- test/
|
95
|
+
- test/test_sys_cpu.rb
|
97
96
|
- test/test_sys_cpu_bsd.rb
|
98
|
-
- test/
|
97
|
+
- test/test_sys_cpu_hpux.rb
|
98
|
+
- test/test_sys_cpu_linux.rb
|
99
99
|
- test/test_sys_cpu_sunos.rb
|
100
100
|
- test/test_sys_cpu_windows.rb
|
101
|
-
- test/
|
102
|
-
- test/test_sys_cpu.rb
|
101
|
+
- test/test_sys_cpu_version.rb
|
103
102
|
- examples
|
104
103
|
- examples/example_sys_cpu_sunos.rb
|
105
104
|
- examples/example_sys_cpu_hpux.rb
|
106
105
|
- examples/example_sys_cpu_linux.rb
|
107
|
-
- examples/example_sys_cpu_windows.rb
|
108
106
|
- examples/example_sys_cpu_bsd.rb
|
107
|
+
- examples/example_sys_cpu_windows.rb
|
109
108
|
- doc
|
110
109
|
- doc/linux.txt
|
111
|
-
- doc/sunos.txt
|
112
110
|
- doc/bsd.txt
|
113
|
-
- doc/windows.txt
|
114
111
|
- doc/hpux.txt
|
115
|
-
-
|
112
|
+
- doc/sunos.txt
|
113
|
+
- doc/windows.txt
|
116
114
|
- install.rb
|
117
|
-
- README
|
118
115
|
- Rakefile
|
119
|
-
-
|
116
|
+
- certs
|
117
|
+
- certs/djberg96_pub.pem
|
120
118
|
- lib
|
121
119
|
- lib/sys-cpu.rb
|
122
120
|
- lib/sys
|
123
|
-
- lib/sys/cpu.rb
|
124
|
-
- lib/sys/windows
|
125
|
-
- lib/sys/windows/sys
|
126
|
-
- lib/sys/windows/sys/cpu.rb
|
127
121
|
- lib/sys/linux
|
128
122
|
- lib/sys/linux/sys
|
129
123
|
- lib/sys/linux/sys/cpu.rb
|
130
124
|
- lib/sys/unix
|
131
125
|
- lib/sys/unix/sys
|
132
126
|
- lib/sys/unix/sys/cpu.rb
|
133
|
-
-
|
134
|
-
-
|
127
|
+
- lib/sys/windows
|
128
|
+
- lib/sys/windows/sys
|
129
|
+
- lib/sys/windows/sys/cpu.rb
|
130
|
+
- lib/sys/cpu.rb
|
131
|
+
- CHANGES.rdoc
|
132
|
+
- MANIFEST.rdoc
|
133
|
+
- README.rdoc
|
134
|
+
- sys-cpu.gemspec
|
135
135
|
homepage: https://github.com/djberg96/sys-cpu
|
136
136
|
licenses:
|
137
137
|
- Apache-2.0
|
metadata.gz.sig
CHANGED
Binary file
|
data/README
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
= Description
|
2
|
-
A Ruby interface for getting cpu information.
|
3
|
-
|
4
|
-
= Installation
|
5
|
-
gem install sys-cpu
|
6
|
-
|
7
|
-
= Adding the trusted cert
|
8
|
-
gem cert --add <(curl -Ls https://raw.githubusercontent.com/djberg96/sys-cpu/ffi/certs/djberg96_pub.pem)
|
9
|
-
|
10
|
-
= Notes
|
11
|
-
== Solaris
|
12
|
-
Currently there is no 'processors()' iterative method for multi-cpu systems.
|
13
|
-
I plan to add it this in a future release.
|
14
|
-
|
15
|
-
== OS X
|
16
|
-
The CPU.model method returns very limited information. I do not yet know
|
17
|
-
how to get more detailed information.
|
18
|
-
|
19
|
-
== Linux
|
20
|
-
This is pure Ruby. This version reads information out of /proc/cpuinfo and
|
21
|
-
/proc/loadavg, so if /proc isn't mounted it won't work.
|
22
|
-
|
23
|
-
The key-value information in /proc/cpuinfo is stored internally (i.e. in
|
24
|
-
memory) as an array of hashes when you first 'require' this package. This
|
25
|
-
overhead is exceptionally minimal, given that your average cpuinfo file
|
26
|
-
contains less than 1k of text (and I don't store whitespace or newlines).
|
27
|
-
|
28
|
-
The text documentation for Linux is dynamically generated during the
|
29
|
-
build process because the fields vary depending on your setup. So, don't
|
30
|
-
look at it until *after* you've installed it. You will see a doc/linux.txt
|
31
|
-
file after you run 'rake install' (via install.rb).
|
32
|
-
|
33
|
-
== HP-UX
|
34
|
-
Unlike other platforms, you can get load averages for an individual cpu in
|
35
|
-
multi-cpu systems. See documentation for more details.
|
36
|
-
|
37
|
-
Note that version 0.7.x and later will not work on HP-UX because of the
|
38
|
-
switch to FFI and the lack of a testing platform. However, version 0.6.x
|
39
|
-
will work just fine.
|
40
|
-
|
41
|
-
== MS Windows
|
42
|
-
This is a pure Ruby implementation using the win32ole package + WMI. The C
|
43
|
-
version has been scrapped.
|
44
|
-
|
45
|
-
As of version 0.5.0, the CPU.usage method has been removed in favor of the
|
46
|
-
CPU.load_avg method. This does not (currently) use a perf counter, so there
|
47
|
-
is no longer any delay. Also, the 'processors' method has been
|
48
|
-
added and the 'supported' method has been dropped. See the documentation
|
49
|
-
for other changes.
|
50
|
-
|
51
|
-
= Acknowledgements
|
52
|
-
Thanks go to the MPlayer team for some source code that helped me on
|
53
|
-
certain versions of FreeBSD in the original C version.
|
54
|
-
|
55
|
-
= Known Bugs
|
56
|
-
None that I'm aware of. Please report bugs on the project page at
|
57
|
-
https://github.com/djberg96/sys-cpu
|
58
|
-
|
59
|
-
= Future Plans
|
60
|
-
Add iterative CPU.processors method.
|
61
|
-
Add more information in general, such as what 'prtdiag' shows.
|
62
|
-
|
63
|
-
= License
|
64
|
-
Artistic 2.0
|
65
|
-
|
66
|
-
= Copyright
|
67
|
-
(C) 2003-2015 Daniel J. Berger, All Rights Reserved
|
68
|
-
|
69
|
-
= Warranty
|
70
|
-
This package is provided "as is" and without any express or
|
71
|
-
implied warranties, including, without limitation, the implied
|
72
|
-
warranties of merchantability and fitness for a particular purpose.
|
73
|
-
|
74
|
-
= Author
|
75
|
-
Daniel J. Berger
|