Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

forgot to multiply by 100.

  • Loading branch information...
commit 85f94e325fc3ca061aac2db6a5a05261e1af5474 1 parent c339c1f
Dhruv Bansal dhruvbansal authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  graphiterb.gemspec
  2. +2 −2 lib/graphiterb/monitors/system.rb
2  graphiterb.gemspec
View
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{graphiterb}
- s.version = "0.2.3"
+ s.version = "0.2.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Philip (flip) Kromer (@mrflip)"]
4 lib/graphiterb/monitors/system.rb
View
@@ -36,7 +36,7 @@ def memory lines
next unless line =~ /^Mem: *(\d+)k *total, *(\d+)k *used, *(\d+)k *free/
total = $1.to_f
return [$2, $3].map do |bytes|
- bytes.to_f / total rescue 0.0
+ 100.0 * (bytes.to_f / total) rescue 0.0
end
end
[0,0]
@@ -47,7 +47,7 @@ def swap lines
next unless line =~ /^Swap: *(\d+)k *total, *(\d+)k *used, *(\d+)k *free/
total = $1.to_f
return [$2, $3].map do |bytes|
- bytes.to_f / total rescue 0.0
+ 100.0 * (bytes.to_f / total) rescue 0.0
end
end
[0,0]
Please sign in to comment.
Something went wrong with that request. Please try again.