Sha256: c0e49751168e1e07998d8e72aeee0b998384be5c47922ad7bc2480523470eb8b

Contents?: true

Size: 1.52 KB

Versions: 25

Compression:

Stored size: 1.52 KB

Contents

== Description
   Sys::CPU - An interface for various cpu statistics
   
== Synopsis
   require "sys/cpu"
   include Sys

   puts "Mhz: " + CPU.cpu_freq.to_s
   puts "State: " + CPU.state(0)
   puts "Number of cpu's on this system: " + CPU.num_cpu.to_s
   puts "Number of active cpu's: " + CPU.num_active_cpu.to_s
   puts "Load averages: " + CPU.load_avg.join(", ")
   
== Constants
VERSION
   Returns the current version number for this package.
    
== Class Methods
CPU.architecture
   Returns the cpu architecture, e.g. PA RISC 1.2, etc.
    
CPU.freq(cpu_num=0)
   Returns an integer indicating the speed (i.e. frequency in Mhz) of
   the cpu.
    
CPU.load_avg
CPU.load_avg(cpu_num)
CPU.load_avg{ |cpu| ... }

   In non-block form returns an array of three floats indicating the 1, 5
   and 15 minute overall load average.

   In block form, it returns an array of three floats indicating the 1, 5
   and 15 minute load average for each cpu.  Only useful on multi-cpu
   systems.

   If 'cpu_num' is provided, returns the load average (as a 3-element
   array) for that cpu only.

   You cannot provide a cpu number and use block form at the same time.
    
CPU.num_cpu
   Returns an integer indicating the number of cpu's on the system.
    
CPU.num_active_cpu
   Returns an integer indicating the number of active cpu's on the system.
    
== Error Classes
CPU::Error < StandardError
   Raised is response to internal function errors, usually relating to an
   invalid cpu number.
    
== More Information
See the README file for more information.

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
sys-cpu-1.1.0 doc/hpux.txt
sys-cpu-1.0.6 doc/hpux.txt
sys-cpu-1.0.5 doc/hpux.txt
sys-cpu-1.0.4 doc/hpux.txt
sys-cpu-1.0.3 doc/hpux.txt
sys-cpu-1.0.2 doc/hpux.txt
sys-cpu-1.0.1 doc/hpux.txt
sys-cpu-1.0.0 doc/hpux.txt
sys-cpu-0.9.0 doc/hpux.txt
sys-cpu-0.8.3 doc/hpux.txt
sys-cpu-0.8.2 doc/hpux.txt
sys-cpu-0.8.1 doc/hpux.txt
sys-cpu-0.8.0 doc/hpux.txt
sys-cpu-0.7.2 doc/hpux.txt
sys-cpu-0.7.1 doc/hpux.txt
sys-cpu-0.7.0-universal-linux doc/hpux.txt
sys-cpu-0.7.0 doc/hpux.txt
sys-cpu-0.6.4-universal-linux doc/hpux.txt
sys-cpu-0.6.4 doc/hpux.txt
sys-cpu-0.6.3-x86-linux doc/hpux.txt