Skip to content

Commit 5083f85

Browse files
committed
Remove test code
1 parent e799c91 commit 5083f85

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

emhttp/plugins/dynamix/DashStats.page

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ foreach ($devs as $disk) {
9595

9696
$array_percent = number_format(100*$array_used/($array_size ?: 1),1,$dot,'');
9797
$cpus=get_cpu_packages();
98-
$cpus[] = ["16,17"];
9998
$wg_up = $wireguard ? exec("wg show interfaces") : '';
10099
$wg_up = $wg_up ? explode(' ',$wg_up) : [];
101100
$up = count($wg_up);
@@ -1456,7 +1455,6 @@ var recall = null;
14561455
var recover = null;
14571456
var tempunit="<?=_var($display,'unit','C');?>";
14581457

1459-
14601458
// Helper function to calculate millisPerPixel based on container width
14611459
function getMillisPerPixel(timeInSeconds, containerId) {
14621460
var container = document.getElementById(containerId);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
function get_cpu_packages(string $separator = ','): array {
3+
$packages = [];
4+
5+
foreach (glob("/sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list") as $path) {
6+
$pkg_id = (int)file_get_contents(dirname($path) . "/physical_package_id");
7+
$siblings = str_replace(",", $separator, trim(file_get_contents($path)));
8+
9+
if (!in_array($siblings, $packages[$pkg_id] ?? [])) {
10+
$packages[$pkg_id][] = $siblings;
11+
}
12+
}
13+
14+
// Sort groups within each package by first CPU number
15+
foreach ($packages as &$list) {
16+
$keys = array_map(fn($s) => (int)explode($separator, $s)[0], $list);
17+
array_multisort($keys, SORT_ASC, SORT_NUMERIC, $list);
18+
}
19+
unset($list);
20+
21+
return $packages;
22+
}

0 commit comments

Comments
 (0)