Added a function in AppModel to check the System Load

This commit is contained in:
Kyle Johnson 2013-09-11 09:22:53 -04:00
parent c41810bbf1
commit 646b511cd4
1 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,15 @@ class AppModel extends Model {
return $return; return $return;
} }
function getSystemLoad()
{
$uptime = shell_exec( 'uptime' );
$load = '';
if ( preg_match( '/load average: ([\d.]+)/', $uptime, $matches ) )
$load = $matches[1];
return( $load );
}
public function reScale( $dimension, $dummy) { public function reScale( $dimension, $dummy) {