[Phpsysinfo-subversion] SF.net SVN: phpsysinfo:[626] trunk/includes/os/class.Haiku.inc.php
Brought to you by:
namiltd
From: <na...@us...> - 2012-08-08 12:56:16
|
Revision: 626 http://phpsysinfo.svn.sourceforge.net/phpsysinfo/?rev=626&view=rev Author: namiltd Date: 2012-08-08 12:56:05 +0000 (Wed, 08 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/includes/os/class.Haiku.inc.php Modified: trunk/includes/os/class.Haiku.inc.php =================================================================== --- trunk/includes/os/class.Haiku.inc.php 2012-08-07 09:58:18 UTC (rev 625) +++ trunk/includes/os/class.Haiku.inc.php 2012-08-08 12:56:05 UTC (rev 626) @@ -194,6 +194,24 @@ } } } + + /** + * Processor Load + * optionally create a loadbar + * + * @return void + */ + private function _loadavg() + { + if (CommonFunctions::executeProgram('top', '-n 1 -i 1', $buf)) { + if (preg_match("/\s+(\S+)%\s+TOTAL\s+\(\S+%\s+idle time/", $buf, $ar_buf)) { + $this->sys->setLoad($ar_buf[1]); + if (PSI_LOAD_BAR) { + $this->sys->setLoadPercent(round($ar_buf[1])); + } + } + } + } /** * Number of Users @@ -367,6 +385,7 @@ $this->_kernel(); $this->_uptime(); $this->_users(); + $this->_loadavg(); $this->_pci(); $this->_usb(); $this->_cpuinfo(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |