PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, ]); // Latest run per node, plus how many runs that node ever posted. $nodes = $db->query( 'SELECT r.*, (SELECT COUNT(*) FROM runs x WHERE x.node = r.node) AS n FROM runs r JOIN (SELECT node, MAX(tested_at) AS m FROM runs GROUP BY node) t ON t.node = r.node AND t.m = r.tested_at ORDER BY r.node' )->fetchAll(); } catch (Throwable $e) { $error = $e->getMessage(); } // PMSS puts the datacenter row in the first two letters of a hostname. Two // rows share one datacenter, and nodes older than the scheme match no row. const ROW_DC = ['le' => 'Lauttasaari', 'lt' => 'Lauttasaari', 'ke' => 'Kerava', 'kt' => 'Kerava', 'k2' => 'Kerava 2']; // The hostname family ("le4", "le6", "lt5") is the hall. It comes from PMSS's // naming, not from the database: no column here knows a datacenter. $halls = []; foreach ($nodes as $row) { $family = explode('-', (string) $row['node'])[0] ?: '?'; $halls[$family][] = $row; } ksort($halls); $peak = 1.0; foreach ($nodes as $row) { $peak = max($peak, (float) ($row['d1m'] ?? 0)); } $racks = []; $plates = []; $offset = 0.0; foreach ($halls as $family => $list) { // "3-229mighty" makes explode() return an int key, so cast before substr(). $dc = ROW_DC[substr((string) $family, 0, 2)] ?? null; // datacenter row, if the name follows the scheme $cols = max(1, min(COLS, count($list))); $rows = (int) ceil(count($list) / $cols); foreach ($list as $i => $row) { $perf = $row['d1m'] === null ? null : (float) $row['d1m']; $ratio = $perf === null ? 0.0 : min(1.0, $perf / $peak); $parts = explode('-', (string) $row['node']); $racks[] = [ 'x' => round($offset + ($i % $cols) * STEP, 3), 'z' => round(intdiv($i, $cols) * STEP, 3), 'hh' => round(0.5 + 1.7 * $ratio, 3), 't' => round($ratio, 3), 'null' => $perf === null, 'label' => end($parts), 'node' => $row['node'], 'tip' => sprintf( "%s\n4k %s MB/s · %s IOPS\n64k %s · 512k %s · 1m %s MB/s\nsend %s · recv %s Mbit/s\n%s · %s cores · %s GiB RAM · %s GiB swap\n%s · %s · %s · GPU %s\n%d run(s), last %s", $row['node'], n($row['d4k']), n($row['d4k_iops'], 0), n($row['d64k']), n($row['d512k']), n($row['d1m']), n($row['send_mbit'], 0), n($row['recv_mbit'], 0), $row['cpu'] ?? 'cpu?', $row['cores'] ?? '?', n($row['ram_gib'], 1), n($row['swap_gib'], 1), $row['disk_gb'] === null ? 'disk?' : n((float) $row['disk_gb'] / 1000, 1) . ' TB', $row['os'] ?? '?', $row['vm'] ?? '?', $row['gpu'] ?? 'none', (int) $row['n'], $row['tested_at'] === null ? '?' : date('Y-m-d H:i T', (int) $row['tested_at']) ), ]; } // Symmetric margin, so every rack sits inside its slab. Offsetting from the // corner left the near rack 0.15 unit outside and 0.7 free on the far side. $w = ($cols - 1) * STEP + 2 * (HALF_W + PAD); $d = ($rows - 1) * STEP + 2 * (HALF_W + PAD); $plates[] = [ 'name' => $dc === null ? (string) $family : $family . ' · ' . $dc, 'x' => round($offset - HALF_W - PAD, 3), 'z' => round(-HALF_W - PAD, 3), 'w' => round($w, 3), 'd' => round($d, 3), ]; $offset += $w + 1.5; } $scene = ['racks' => $racks, 'plates' => $plates, 'width' => round(max($offset, 4), 3), 'peak' => $peak, 'step' => STEP]; ?> YABS hangar

YABS hangar

One hall per hostname family, one rack per node, height and colour from the latest 1M fio throughput. Hover a rack for its numbers. node(s), peak MB/s.
The first two letters of a PMSS hostname name a datacenter row: le and lt are Lauttasaari, ke and kt are Kerava, and a second Kerava DC will be k2. Older nodes predate the scheme and show their family alone.