Added a function in AppModel to check the System Load
This commit is contained in:
parent
c41810bbf1
commit
646b511cd4
|
@ -47,6 +47,15 @@ class AppModel extends Model {
|
|||
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) {
|
||||
|
|
Loading…
Reference in New Issue