mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 20:55:28 +00:00
Merge branch 'devel' into new/FTL-integration
This commit is contained in:
@@ -65,9 +65,18 @@
|
||||
|
||||
// Get load
|
||||
$loaddata = sys_getloadavg();
|
||||
foreach ($loaddata as $key => $value) {
|
||||
$loaddata[$key] = round($value, 2);
|
||||
}
|
||||
// Get number of processing units available to PHP
|
||||
// (may be less than the number of online processors)
|
||||
$nproc = shell_exec('nproc');
|
||||
if(!is_numeric($nproc))
|
||||
{
|
||||
$cpuinfo = file_get_contents('/proc/cpuinfo');
|
||||
preg_match_all('/^processor/m', $cpuinfo, $matches);
|
||||
$nproc = count($matches[0]);
|
||||
}
|
||||
|
||||
// Get memory usage
|
||||
$data = explode("\n", file_get_contents("/proc/meminfo"));
|
||||
@@ -325,7 +334,7 @@
|
||||
{
|
||||
echo "#7FFF00";
|
||||
}
|
||||
echo "\"></i> Load: " . $loaddata[0] . " " . $loaddata[1] . " ". $loaddata[2] . "</a>";
|
||||
echo "\" title=\"Detected $nproc cores\"></i> Load: " . $loaddata[0] . " " . $loaddata[1] . " ". $loaddata[2] . "</a>";
|
||||
?>
|
||||
<br/>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user