Module: Cuboid::System::Platforms::Mixins::Unix

Defined in:
lib/cuboid/system/platforms/mixins/unix.rb

Instance Method Summary collapse

Instance Method Details

#disk_space_freeInteger



27
28
29
# File 'lib/cuboid/system/platforms/mixins/unix.rb', line 27

def disk_space_free
    Vmstat.disk( disk_directory ).available_bytes
end

#memory_for_process_group(pgid) ⇒ Integer



15
16
17
18
19
20
21
22
23
# File 'lib/cuboid/system/platforms/mixins/unix.rb', line 15

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