Sha256: 72c749fc3eb38505d6222fadd8a7b1bc9955c9f3890ddb00d9a92ed3d3a9c0f3

Contents?: true

Size: 528 Bytes

Versions: 3

Compression:

Stored size: 528 Bytes

Contents

=begin rdoc
  Basic monitor on the cpu stats
=end
module Web
  module Master
    # Get the average web request capabilities over the cloud
    def web
      nodes.size > 0 ? nodes.inject(0) {|i,a| i += a.web } / nodes.size : 0.0
    end
  end

  module Remote
    def web
      str = ssh("httperf --server localhost --port #{Application.client_port} --num-conn 3 --timeout 5 | grep 'Request rate'")
      str[/[.]* ([\d]*\.[\d]*) [.]*/, 0].chomp.to_f
    rescue
      0.0
    end    
  end
  
end

PoolParty.register_monitor Web

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
auser-poolparty-0.0.8 lib/poolparty/monitors/web.rb
auser-poolparty-0.0.9 lib/poolparty/monitors/web.rb
dreadpiratepj-poolparty-0.0.8 lib/poolparty/monitors/web.rb