Sha256: f98996ded59d83010554d6611a40db853d193d5b29c608300dc49b681b78376c

Contents?: true

Size: 1.6 KB

Versions: 16

Compression:

Stored size: 1.6 KB

Contents

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

   # Solaris
   puts "Mhz: " + CPU.cpu_freq(0).to_s
   puts "State: " + CPU.state(0)
   puts "Number of cpu's on this system: " + CPU.num_cpu.to_s
   puts "CPU type: " + CPU.architecture
   puts "FPU type: " + CPU.fpu_type
   puts "CPU model: " + CPU.model
   puts "Load averages: " + CPU.load_avg.join(", ")
   
== Constants
VERSION
   Returns the current version number for this package.
    
== Class Methods
CPU.freq(cpu_num=0)
   Returns an integer indicating the speed (i.e. frequency in Mhz) of
   'cpu_num', or CPU 0 if no number is provided.
    
CPU.architecture
   Returns a string indicating the type of processor.  This is the
   architecture (e.g. sparcv9), not the exact model (e.g. Ultra-IIe).
   Returns nil if not found.
    
CPU.fpu_type
   Returns a string indicating the type of floating point unit, or nil if
   not found.
    
CPU.load_avg
   Returns an array of three floats indicating the 1, 5 and 15 minute load
   average.
    
CPU.model
   Returns a string indicating the cpu model.  For now, this is the
   architecture type, rather than the exact model.  However, see the
   'Future Plans' section below.
    
CPU.num_cpu
   Returns an integer indicating the number of cpu's on the system.
    
CPU.state(cpu_num)
   Returns a string indicating the cpu state of 'cpu_num'.
    
== 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

16 entries across 16 versions & 1 rubygems

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