module Vmstat::Stub
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}.
Public Class Methods
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
# File lib/vmstat/stub.rb, line 10 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 ...>]
# File lib/vmstat/stub.rb, line 18 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, ...>
# File lib/vmstat/stub.rb, line 27 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=...>
# File lib/vmstat/stub.rb, line 35 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 ...>
# File lib/vmstat/stub.rb, line 43 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 ...>, ...]
# File lib/vmstat/stub.rb, line 51 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
# File lib/vmstat/stub.rb, line 59 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 ...>
# File lib/vmstat/stub.rb, line 68 def self.task nil end