Remove test code

This commit is contained in:
SimonFair
2025-10-22 22:00:41 +01:00
parent e799c9144d
commit 5083f85d8a
2 changed files with 22 additions and 2 deletions

View File

@@ -95,7 +95,6 @@ foreach ($devs as $disk) {
$array_percent = number_format(100*$array_used/($array_size ?: 1),1,$dot,'');
$cpus=get_cpu_packages();
$cpus[] = ["16,17"];
$wg_up = $wireguard ? exec("wg show interfaces") : '';
$wg_up = $wg_up ? explode(' ',$wg_up) : [];
$up = count($wg_up);
@@ -1456,7 +1455,6 @@ var recall = null;
var recover = null;
var tempunit="<?=_var($display,'unit','C');?>";
// Helper function to calculate millisPerPixel based on container width
function getMillisPerPixel(timeInSeconds, containerId) {
var container = document.getElementById(containerId);

View File

@@ -0,0 +1,22 @@
<?php
function get_cpu_packages(string $separator = ','): array {
$packages = [];
foreach (glob("/sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list") as $path) {
$pkg_id = (int)file_get_contents(dirname($path) . "/physical_package_id");
$siblings = str_replace(",", $separator, trim(file_get_contents($path)));
if (!in_array($siblings, $packages[$pkg_id] ?? [])) {
$packages[$pkg_id][] = $siblings;
}
}
// Sort groups within each package by first CPU number
foreach ($packages as &$list) {
$keys = array_map(fn($s) => (int)explode($separator, $s)[0], $list);
array_multisort($keys, SORT_ASC, SORT_NUMERIC, $list);
}
unset($list);
return $packages;
}