Method: LinuxStat::OS.loadavg
- Defined in:
- lib/linux_stat/os.rb
.loadavg ⇒ Object
or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. They are the same as the load average numbers given by uptime(1) and other programs. man7.org/linux/man-pages/man5/procfs.5.html
The return type is an Hash containing the values that maps to 1, 5, and 15. This method calls LinuxStat::Sysinfo.loads() directly.
However, if the info isn’t available, it will return nil as values.
208 209 210 211 212 213 214 215 216 |
# File 'lib/linux_stat/os.rb', line 208 def loadavg loads = LinuxStat::Sysinfo.loads { 1 => loads[0], 5 => loads[1], 15 => loads[2] } end |