lib/heartbeat-client.rb in heartbeat-client-0.1.4 vs lib/heartbeat-client.rb in heartbeat-client-0.1.5

- old
+ new

@@ -1,14 +1,12 @@ require 'rubygems' gem 'httparty' require 'httparty' require 'logger' -require "sys/cpu" rescue nil require 'pp' class Heartbeat - include Sys include HTTParty base_uri 'http://heartbeat-server.herokuapp.com' def self.is_mac? RUBY_PLATFORM.downcase.include?("darwin") @@ -23,12 +21,10 @@ end def self.create(apikey) cpu = 0; load_average = 0; memory_used = 0; memory_free = 0 - if self.is_mac? - load_average = CPU.load_avg.first - elsif self.is_linux? + if self.is_linux? cpus = `iostat -c`.split cpu = 100 - cpus.last.to_i end options = {