Sha256: 8c52d064b242903090af63abff331342a81437260d94075525241f5b9b521ebd
Contents?: true
Size: 749 Bytes
Versions: 32
Compression:
Stored size: 749 Bytes
Contents
require 'vmstat' module Cuboid class System module Platforms module Mixins module Unix # @param [Integer] pgid # Process group ID. # # @return [Integer] # Amount of RAM in bytes used by the given GPID. def memory_for_process_group( pgid ) rss = 0 _exec( "ps -o rss -g #{pgid}" ).split("\n")[1..-1].each do |rss_string| rss += rss_string.to_i end rss * pagesize end # @return [Integer] # Amount of free disk in bytes. def disk_space_free Vmstat.disk( disk_directory ).available_bytes end private def pagesize @pagesize ||= memory.pagesize end def memory Vmstat.memory end end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems