Module: Process::Metrics::Host

Defined in:
lib/process/metrics/host/memory.rb,
lib/process/metrics/host.rb,
lib/process/metrics/host/memory/linux.rb,
lib/process/metrics/host/memory/darwin.rb,
lib/process/metrics/host/memory/linux/meminfo.rb,
lib/process/metrics/host/memory/linux/cgroup_v1.rb,
lib/process/metrics/host/memory/linux/cgroup_v2.rb

Overview

Per-host (system-wide) memory metrics. Use Host::Memory for total/used/free and swap; use Process::Metrics::Memory for per-process metrics.

Defined Under Namespace

Classes: Memory

Class Method Summary collapse

Class Method Details

.nameObject

System name from uname -a (kernel name, nodename, release, etc.). Returns nil if uname is not available.



13
14
15
16
17
# File 'lib/process/metrics/host.rb', line 13

def self.name
	IO.popen(["uname", "-a"], "r", &:read)&.strip
rescue Errno::ENOENT
	nil
end