Closed SubrataM3 closed 5 years ago
Hey, thanks for reaching out.
Getting CPU usage is a kind of a tricky operation and requires a little bit more in terms of usage. I’ll reply back later with more details (on my phone now and can’t easily look trough things).
Regards
Hi, any update on this?
Try
$linfo = new \Linfo\Linfo;
$parser = $linfo->getParser();
$parser->determineCPUPercentage();
$cpu = $parser->getCPUUsage();
var_dump($cpu);
That works perfectly ! Thank you. :-)
Code
Output
RAM usage,Uptime etc works fine though.
System Info PHP =>
PHP 7.2.8 (cli) (built: Jul 17 2018 09:50:46) ( NTS )
OS =>CentOS Linux release 7.5.1804 (Core)
Kernel =>Linux localhost 3.10.0-862.9.1.el7.x86_64
Its a local virtual machine, so nothing is restricted on PHP side. Please let me know if you need any further information.
Thank you.