Class ProcStat

Description

Class to provide information to the values found in: '/proc/stat'.

This class extracts useful information from '/proc/stat' which can then be posted back within a XML document (think AJAX response).

  1.  $ps1 new ProcStat();
  2.  sleep(5);
  3.  $ps2 new ProcStat();
  4.  
  5.  $ps->computeCpuUsage(.75);
  6.  $props new WuiProperties();
  7.  $props->setComment("/proc/stat info");
  8.  $props->addStandardProperties();
  9.  ProcStat::storeProperties($props$ps1$ps2);
  10.  $props->renderPage();

Located in /lib/ProcStat.php (line 337)


	
			
Method Summary
static void storeProperties (Properties $props, ProcStat $ps0, ProcStat $ps1)
ProcStat __construct ()
Methods
static method storeProperties (line 452)

Stores information derived from '/proc/stat' into a Properties object.

The start/end time fields will be added:

proc.start.time SECS: Count of seconds (floating point) since the epoch (converts nicely to Java, JavaScript, C). When the first sample was taken.</dd>

proc.end.time SECS: Count of seconds (floating point) since the epoch (converts nicely to Java, JavaScript, C). When the second sample was taken.</dd>

The following values from the second reading reading will be included (if available):

proc.forked CNT: Number of processes forked since system came up.

proc.running CNT: Number of processes currently running.

proc.blocked CNT: Number of processes currently blocked.

If the CPU usage has been computed, the following fields will be added:

cpu.usage [0, 1.0]: How much of the CPU was being used where 0.0 indicates no load and 1.0 indicates full load.</dd>

cpu.user COUNT: Count of how much of the time was spent running normal user processes.

cpu.userNice COUNT: Count of how much of the time was spent running nice user processes.

cpu.system COUNT: Count of how much of the time was spent running system code.

cpu.idle COUNT: Count of how much of the time was spent idle.

cpu.ioWait COUNT: Count of how much of the time was spent waiting on I/O.

cpu.hardIrq COUNT: Count of time servicing hardware IRQs?

cpu.softIrq COUNT: Count of time servicing software IRQs?

cpu.stolen COUNT: Count of time stolen by virtualization?

cpu.guest COUNT: Count of time associated with Guest CPU (new in 2.6.24)?

cpu.guestNice COUNT: Count of time associated with Guest CPU niced (new in 2.6.33)?

NOTE: If the system has more than one CPU (or core), the above information will be repeated for each CPU (or core) with a prefix of cpu0.

  • access: public
static void storeProperties (Properties $props, ProcStat $ps0, ProcStat $ps1)
Constructor __construct (line 359)

Default constructor will read in the current state information from /proc/stat.

  • access: public
ProcStat __construct ()

Documentation generated on Sun, 11 Feb 2018 07:41:02 -0500 by phpDocumentor 1.4.4