cloudscopes 0.12.4 → 0.12.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 665483c84651e9195847877191797d7f97d6e236
4
- data.tar.gz: d188686e5d9160702997257937bc8296c49b623e
3
+ metadata.gz: 13a8c1e4fd96446ee9cfb730470ffbd144b336a2
4
+ data.tar.gz: e19c5195b89ffaf6cda0805183bf61e3a6129ac4
5
5
  SHA512:
6
- metadata.gz: 6a7bcd5be66139c5832975546e9e0631e18dae69c0ceab1827ae46a99a2ddeb0f2daa8d13ae0208104b2b6977c574f6ecc63dd1aac65391166d930dad454c574
7
- data.tar.gz: 7f203a96c24cb17f7f9b62c845e6b467953bab12dbf18b1fe922deba3a237447de99b74096d405830131d20f268124083fe71f0747ad04af0b10825c48a55575
6
+ metadata.gz: 211373e4fe776df95c5ac33283d43f85e4f579277e525d68ba039a0b22567215244aa6bf2c47e192b442bc0534ff667eb5cd6e07874dfc9076171ce9ae5eb8f6
7
+ data.tar.gz: 94479bbf4b7456bcd4c4314d4200c215f0855e3bc93bd670c0ae469a32968597b781aa1cb58c6c66ed88b918c45e06b5ad615854f19802f0588c6a256ce0cdc2
@@ -10,7 +10,7 @@ module Cloudscopes
10
10
 
11
11
  def initialize(id)
12
12
  @id = id.to_i
13
- raise "Invalid system process id #{id}" unless @id > 0 && @id <= @@maxpid
13
+ raise "Invalid system process id #{id}" unless @id > 0 && @id < @@maxpid
14
14
  end
15
15
 
16
16
  def procpath(field = nil)
@@ -56,20 +56,13 @@ module Cloudscopes
56
56
  Etc.getpwuid(uid || 0).name
57
57
  end
58
58
 
59
- def mem_usage
60
- # lots of magic follow, peruse at your own risk
61
- maps.strip.split("\n").collect do |l|
62
- l.split(/\s+/)
63
- end.select do |r|
64
- r[4].to_i == 0 && r[1] !~ /s/
65
- end.collect do |r|
66
- b,e = r[0].split(/-/,2).collect{ |a| a.to_i(16) }
67
- r[0] = e - b
68
- r
69
- end.inject(0) do |s,r|
70
- s += r[0]
71
- end
59
+ def mem_usage_rss
60
+ statm.strip.split(/\s+/)[1].to_i * Etc.sysconf(Etc::SC_PAGESIZE)
61
+ end
62
+ def mem_usage_virt
63
+ statm.strip.split(/\s+/)[0].to_i * Etc.sysconf(Etc::SC_PAGESIZE)
72
64
  end
65
+ alias mem_usage mem_usage_virt
73
66
  end
74
67
 
75
68
  def list
@@ -1,3 +1,3 @@
1
1
  module Cloudscopes
2
- VERSION = "0.12.4"
2
+ VERSION = "0.12.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudscopes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.4
4
+ version: 0.12.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Arbel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
11
+ date: 2016-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.4.6
131
+ rubygems_version: 2.5.1
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Ruby gem to report system statistics to web based monitoring services such