linux-kstat 0.2.1-universal-linux → 0.2.2-universal-linux
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 +3 -0
- data/lib/linux/kstat.rb +21 -15
- data/linux-kstat.gemspec +1 -1
- data/spec/linux_kstat_spec.rb +2 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 530e0d88b03c26ac74b45bd918cdeadf8fb6c2daa13e83a5f1e12029217298e9
|
4
|
+
data.tar.gz: 4f882bbd1933d6f0bf1edb860c19dad5fb01d1f446824485508ab603ec30a5f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13983746b47e2cdbb65abae12030d064cf0ef73062bbe861060a426a313aa8e3f07468126353ba77e93b5f9cb6dfd4985efbda140f3a2482c29905d303f93674
|
7
|
+
data.tar.gz: 00f4ee4e8719b1f443e989afc1ff3cfe9a679edd70cde22a1979776c2f15128ffe8cec7077e11d25d10ec9a131c2296c7383dc1ab3b32ff0a54859b2e0f68357
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
data/lib/linux/kstat.rb
CHANGED
@@ -7,7 +7,7 @@ module Linux
|
|
7
7
|
extend Forwardable
|
8
8
|
|
9
9
|
# The version of the linux-kstat library
|
10
|
-
VERSION = '0.2.
|
10
|
+
VERSION = '0.2.2'.freeze
|
11
11
|
|
12
12
|
# :stopdoc:
|
13
13
|
|
@@ -26,13 +26,16 @@ module Linux
|
|
26
26
|
# kstat = Linux::Kstat.new
|
27
27
|
#
|
28
28
|
# kstat[:cpu] => {
|
29
|
-
# :idle
|
30
|
-
# :iowait
|
31
|
-
# :irq
|
32
|
-
# :softirq
|
33
|
-
# :system
|
34
|
-
# :nice
|
35
|
-
# :user
|
29
|
+
# :idle => 250713454,
|
30
|
+
# :iowait => 2745691,
|
31
|
+
# :irq => 39717,
|
32
|
+
# :softirq => 31323,
|
33
|
+
# :system => 1881655,
|
34
|
+
# :nice => 117158,
|
35
|
+
# :user => 7137418,
|
36
|
+
# :steal => 0,
|
37
|
+
# :guest => 1162987977,
|
38
|
+
# :guest_nice => 0
|
36
39
|
# }
|
37
40
|
#
|
38
41
|
# kstat[:processes] # => 1299560
|
@@ -54,13 +57,16 @@ module Linux
|
|
54
57
|
unless info.empty?
|
55
58
|
if info.first =~ /^cpu/i
|
56
59
|
hash[info.first.to_sym] = {
|
57
|
-
:user
|
58
|
-
:nice
|
59
|
-
:system
|
60
|
-
:idle
|
61
|
-
:iowait
|
62
|
-
:irq
|
63
|
-
:softirq
|
60
|
+
:user => info[1].to_i,
|
61
|
+
:nice => info[2].to_i,
|
62
|
+
:system => info[3].to_i,
|
63
|
+
:idle => info[4].to_i,
|
64
|
+
:iowait => info[5].to_i,
|
65
|
+
:irq => info[6].to_i,
|
66
|
+
:softirq => info[7].to_i,
|
67
|
+
:steal => info[8].to_i,
|
68
|
+
:guest => info[9].to_i,
|
69
|
+
:guest_nice => info[10].to_i
|
64
70
|
}
|
65
71
|
else
|
66
72
|
if info.size > 2
|
data/linux-kstat.gemspec
CHANGED
data/spec/linux_kstat_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Linux::Kstat do
|
|
11
11
|
|
12
12
|
context "constants" do
|
13
13
|
it "defines a version constant that is set to the expected value" do
|
14
|
-
expect(Linux::Kstat::VERSION).to eql('0.2.
|
14
|
+
expect(Linux::Kstat::VERSION).to eql('0.2.2')
|
15
15
|
expect(Linux::Kstat::VERSION.frozen?).to be(true)
|
16
16
|
end
|
17
17
|
end
|
@@ -20,6 +20,7 @@ describe Linux::Kstat do
|
|
20
20
|
it "allows hash style key access" do
|
21
21
|
expect(subject).to respond_to(:[])
|
22
22
|
expect{ subject[:cpu] }.to_not raise_error
|
23
|
+
expect(subject[:cpu].keys.size).to eql(10)
|
23
24
|
end
|
24
25
|
|
25
26
|
it "contains the expected keys and value types" do
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|