File: linux_memory.rb

package info (click to toggle)
ruby-vmstat 2.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 344 kB
  • sloc: ruby: 1,136; ansic: 347; makefile: 3
file content (13 lines) | stat: -rw-r--r-- 419 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
# @attr [Fixnum] available
#   The estimated available memory (linux)
#   See: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
class Vmstat::LinuxMemory < Vmstat::Memory
  attr_accessor :available

  # Calculate the available bytes based of the active pages.
  # @return [Fixnum] active bytes
  def available_bytes
    available * pagesize
  end
end