Kanrisuru

Memory

The Kanrisuru::Remote::Memory class helps with getting the memory stats on a remote host.

Public Class Methods

new

Creates a new instace of the memory class. Requires a host instance as the only argument.

memory = Kanrisuru::Remote::Memory.new(host)
memory.total
16397092

Public Instance Methods

total

Get the total memory of a host. Can optionally pass in a unit to convert the value to.

memory.total(:mb)
16397.092

memory.total(:gigabyte)
16.397092

free

Get the availabe memory for a host. Can optionally pass in a unit to convert the value to.

memory.free(:gb)
14.347259999999999

swap

Get the total amount of physical swap memory. Can optionally pass in a unit to convert the value to.

memory.swap
0

swap_free

Get the total amount of free swap memory. Can optionally pass in a unit to convert the value to.

memory.swap_free
0