Added a function in AppModel to check the System Load
This commit is contained in:
parent
c41810bbf1
commit
646b511cd4
|
@ -46,6 +46,15 @@ class AppModel extends Model {
|
|||
$return = exec( $string );
|
||||
return $return;
|
||||
}
|
||||
|
||||
function getSystemLoad()
|
||||
{
|
||||
$uptime = shell_exec( 'uptime' );
|
||||
$load = '';
|
||||
if ( preg_match( '/load average: ([\d.]+)/', $uptime, $matches ) )
|
||||
$load = $matches[1];
|
||||
return( $load );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue