Sha256: 840b7f8e79d26947a32a283b30fc064636d5a61aa24f0e99b2ac098f07a0f09e
Contents?: true
Size: 417 Bytes
Versions: 11
Compression:
Stored size: 417 Bytes
Contents
class Nginx include Watchman def self.data out = PS.data.inject({:masters => [], :workers => []}) do |acc,line| if line[:command][/^nginx: master/] acc[:masters] << line end if line[:command][/^nginx: worker/] acc[:workers] << line end acc end out.merge({:num_masters => out[:masters].count, :num_workers => out[:workers].count, :summary => [:num_masters, :num_workers]}) end end
Version data entries
11 entries across 11 versions & 1 rubygems