1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
module Vmstat
# This is a stub module that should be replaced by system specific
# implementations of the different functions. This can either be native or
# with other modules like {ProcFS}.
module Stub
# Fetches the boot time of the system.
# @return [Time] the boot time as regular time object.
# @example
# Vmstat.boot_time # => 2012-10-09 18:42:37 +0200
def self.boot_time
nil
end
# Fetches the cpu statistics (usage counter for user, nice, system and idle)
# @return [Array<Vmstat::Cpu>] the array of cpu counter
# @example
# Vmstat.cpu # => [#<struct Vmstat::Cpu ...>, #<struct Vmstat::Cpu ...>]
def self.cpu
[]
end
# Fetches the usage data and other useful disk information for the given path.
# @param [String] path the path (mount point or device path) to the disk
# @return [Vmstat::Disk] the disk information
# @example
# Vmstat.disk("/") # => #<struct Vmstat::Disk type=:hfs, ...>
def self.disk(path)
nil
end
# Fetches the load average for the current system.
# @return [Vmstat::LoadAverage] the load average data
# @example
# Vmstat.load_average # => #<struct Vmstat::LoadAverage one_minute=...>
def self.load_average
nil
end
# Fetches the memory usage information.
# @return [Vmstat::Memory] the memory data like free, used und total.
# @example
# Vmstat.memory # => #<struct Vmstat::Memory ...>
def self.memory
nil
end
# Fetches the information for all available network devices.
# @return [Array<Vmstat::NetworkInterface>] the network device information
# @example
# Vmstat.network_interfaces # => [#<struct Vmstat::NetworkInterface ...>, ...]
def self.network_interfaces
[]
end
# Fetches pagesize of the current system.
# @return [Fixnum] the pagesize of the current system in bytes.
# @example
# Vmstat.pagesize # => 4096
def self.pagesize
4096
end
# Fetches time and memory usage for the current process.
# @note Currently only on Mac OS X
# @return [Array<Vmstat::Task>] the network device information
# @example
# Vmstat.task # => #<struct Vmstat::Task ...>
def self.task
nil
end
end
end
|