Sha256: bb6489e0373f7865fbc15635cf3932949396275eda452b2ab164bfd0da60acfd

Contents?: true

Size: 699 Bytes

Versions: 27

Compression:

Stored size: 699 Bytes

Contents

class Unicorns
	
	include Watchman
	
	def self.data
		out = PS.data.inject({:masters => [], :workers => [], :master_memory => 0, :worker_memory => 0, :total_memory => 0}) do |acc,line|
			if line[:command][/^start master/]
				acc[:masters] << line
				acc[:master_memory] += line[:rss].to_i
				acc[:total_memory] += line[:rss].to_i
			end
			if line[:command][/^start worker/]
				acc[:workers] << line
				acc[:worker_memory] += line[:rss].to_i
				acc[:total_memory] += line[:rss].to_i
			end
			acc
		end
		out.merge({:num_masters => out[:masters].count, :num_workers => out[:workers].count, :summary => [:num_masters, :num_workers]})
	end
	
	add_rule(:high_memory_usage) do |dat|
		
	end
	
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
city-watch-0.7.9 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.8 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.7 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.6 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.5 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.4 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.3 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.2 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.1 lib/city_watch/watchmen/unicorns.rb
city-watch-0.7.0 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.9 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.8 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.7 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.6 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.5 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.4 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.3 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.2 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.1 lib/city_watch/watchmen/unicorns.rb
city-watch-0.6.0 lib/city_watch/watchmen/unicorns.rb