server_metrics 0.0.8.1 → 0.0.8.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ class ServerMetrics::Disk < ServerMetrics::MultiCollector
|
|
24
24
|
headers = header_line.split(/\s+/,num_columns)
|
25
25
|
parsed_lines=[] # Each line will look like {"%iused" => "38%","Avail" => "289Gi", "Capacity=> "38%", "Filesystem"=> "/dev/disk0s2","Mounted => "/", "Size" => "465Gi", "Used" => "176Gi", "ifree" => "75812051", "iused" => "46116178"}
|
26
26
|
|
27
|
-
@df_output[1..@df_output.size-
|
27
|
+
@df_output[1..@df_output.size-1].each do |line|
|
28
28
|
values=line.split(/\s+/,num_columns)
|
29
29
|
parsed_lines<<Hash[headers.zip(values)]
|
30
30
|
end
|
data/test/test_with_fixtures.rb
CHANGED
@@ -35,6 +35,7 @@ class TestWithFixtures < Test::Unit::TestCase
|
|
35
35
|
|
36
36
|
# First run we get size info
|
37
37
|
def test_disk
|
38
|
+
ServerMetrics::Disk.any_instance.stubs("linux?").returns(true)
|
38
39
|
c = ServerMetrics::Disk.new()
|
39
40
|
fixture = fixtures(:disk)
|
40
41
|
c.expects(:`).with("mount").returns(fixture.command("mount")).once
|
@@ -57,6 +58,7 @@ class TestWithFixtures < Test::Unit::TestCase
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def test_disk_converts_use_percent_and_capacity_to_used_percent
|
61
|
+
ServerMetrics::Disk.any_instance.stubs("linux?").returns(true)
|
60
62
|
response_varieties = []
|
61
63
|
response_varieties << <<-eos
|
62
64
|
Filesystem Capacity
|
@@ -129,6 +131,7 @@ eos
|
|
129
131
|
end
|
130
132
|
|
131
133
|
def test_network
|
134
|
+
ServerMetrics::Network.any_instance.stubs("linux?").returns(true)
|
132
135
|
fixture = fixtures(:network)
|
133
136
|
c = ServerMetrics::Network.new()
|
134
137
|
c.expects(:`).with("cat /proc/net/dev").returns(fixture.command("cat /proc/net/dev")).once
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: server_metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.8.
|
4
|
+
version: 0.0.8.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sys-proctable
|
@@ -171,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
segments:
|
173
173
|
- 0
|
174
|
-
hash:
|
174
|
+
hash: 1007852346529552357
|
175
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
176
|
none: false
|
177
177
|
requirements:
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
version: '0'
|
181
181
|
segments:
|
182
182
|
- 0
|
183
|
-
hash:
|
183
|
+
hash: 1007852346529552357
|
184
184
|
requirements: []
|
185
185
|
rubyforge_project:
|
186
186
|
rubygems_version: 1.8.25
|