vmstat 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c680412d4bf38d53b7b34a35b40708520fcaa521
4
+ data.tar.gz: e3e5033a0556c82cfbf7f0d23e876a96c55d7065
5
+ SHA512:
6
+ metadata.gz: 6070e29648a1274fe62a498f2ef4972d8f4e1fb3898e4226277eca39a82131771ac4fa21810accb082686b01f44847571409f285a95996d59cfe807a9bd73b64
7
+ data.tar.gz: 4d725d090de11fbf164203d6b787f6f357dbdf8973c79633db2a4d0125b8c91946444d28eea410caf3b03a51d7051c272c87dd89d9e0456f7c06b1a75fa09281
@@ -0,0 +1 @@
1
+ vmstat
@@ -0,0 +1 @@
1
+ 2.0.0
@@ -1,3 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ - 2.0.0
@@ -39,5 +39,11 @@ module Vmstat
39
39
  def free_bytes
40
40
  free * pagesize
41
41
  end
42
+
43
+ # Calculate the total bytes based of all pages
44
+ # @return [Fixnum] total bytes
45
+ def total_bytes
46
+ (wired + active + inactive + free) * pagesize
47
+ end
42
48
  end
43
49
  end
@@ -1,3 +1,3 @@
1
1
  module Vmstat
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -17,6 +17,7 @@ describe Vmstat::Memory do
17
17
  its(:active_bytes) { should == 803414016 }
18
18
  its(:inactive_bytes) { should == 1791979520 }
19
19
  its(:free_bytes) { should == 2808213504 }
20
+ its(:total_bytes) { should == 8580386816 }
20
21
 
21
22
  its(:pageins) { should == 1560532 }
22
23
  its(:pageouts) { should == 0 }
@@ -43,6 +44,7 @@ describe Vmstat::Memory do
43
44
  it { should respond_to(:active_bytes) }
44
45
  it { should respond_to(:inactive_bytes) }
45
46
  it { should respond_to(:free_bytes) }
47
+ it { should respond_to(:total_bytes)}
46
48
  end
47
49
 
48
50
  context "content" do
@@ -58,6 +60,7 @@ describe Vmstat::Memory do
58
60
  its(:active_bytes) { should be_a_kind_of(Numeric) }
59
61
  its(:inactive_bytes) { should be_a_kind_of(Numeric) }
60
62
  its(:free_bytes) { should be_a_kind_of(Numeric) }
63
+ its(:total_bytes) { should be_a_kind_of(Numeric) }
61
64
  end
62
65
  end
63
66
  end
@@ -24,12 +24,15 @@ describe Vmstat do
24
24
  end
25
25
 
26
26
  context "performance" do
27
+ percent = RUBY_VERSION.to_i == 2 ? 26 : 10
28
+
27
29
  shared_examples "a not memory leaking method" do |method_name, *args|
28
- it "should not grow the memory in method #{method_name} more than 10% " do
30
+ it "should not grow the memory in method #{method_name} " +
31
+ "more than #{percent}% " do
29
32
  mem_before = Vmstat.task.resident_size
30
33
  10000.times { Vmstat.send(method_name, *args) }
31
34
  mem_after = Vmstat.task.resident_size
32
- mem_after.should < (mem_before * 1.10)
35
+ mem_after.should < (mem_before * (1 + percent / 100.0))
33
36
  end
34
37
  end
35
38
 
metadata CHANGED
@@ -1,97 +1,86 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmstat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
5
- prerelease:
4
+ version: 2.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Vincent Landgraf
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-10-27 00:00:00.000000000 Z
11
+ date: 2013-12-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake-compiler
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: guard-rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: timecop
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
- description: ! "\n A focused and fast library to gather memory, \n cpu, network,
83
+ description: "\n A focused and fast library to gather memory, \n cpu, network,
95
84
  load avg and disk information\n "
96
85
  email:
97
86
  - vilandgr@googlemail.com
@@ -102,7 +91,8 @@ extra_rdoc_files: []
102
91
  files:
103
92
  - .gitignore
104
93
  - .rspec
105
- - .rvmrc
94
+ - .ruby-gemset
95
+ - .ruby-version
106
96
  - .travis.yml
107
97
  - Gemfile
108
98
  - Guardfile
@@ -149,33 +139,26 @@ files:
149
139
  - vmstat.gemspec
150
140
  homepage: http://threez.github.com/ruby-vmstat/
151
141
  licenses: []
142
+ metadata: {}
152
143
  post_install_message:
153
144
  rdoc_options: []
154
145
  require_paths:
155
146
  - lib
156
147
  required_ruby_version: !ruby/object:Gem::Requirement
157
- none: false
158
148
  requirements:
159
- - - ! '>='
149
+ - - '>='
160
150
  - !ruby/object:Gem::Version
161
151
  version: '0'
162
- segments:
163
- - 0
164
- hash: -3973347779729246928
165
152
  required_rubygems_version: !ruby/object:Gem::Requirement
166
- none: false
167
153
  requirements:
168
- - - ! '>='
154
+ - - '>='
169
155
  - !ruby/object:Gem::Version
170
156
  version: '0'
171
- segments:
172
- - 0
173
- hash: -3973347779729246928
174
157
  requirements: []
175
158
  rubyforge_project:
176
- rubygems_version: 1.8.24
159
+ rubygems_version: 2.0.3
177
160
  signing_key:
178
- specification_version: 3
161
+ specification_version: 4
179
162
  summary: A focused and fast library to gather system information
180
163
  test_files:
181
164
  - spec/procfs/loadavg
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 1.9.3-head