From 7d2d1c6cdc984b5c25ab6b3a40bd6614b17d0ef9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 4 Jul 2022 16:58:45 +0200 Subject: [vmstore/main] Use property list for results so they work cross-session --- modules-available/vmstore/inc/vmstorebenchmark.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'modules-available/vmstore/inc/vmstorebenchmark.inc.php') diff --git a/modules-available/vmstore/inc/vmstorebenchmark.inc.php b/modules-available/vmstore/inc/vmstorebenchmark.inc.php index 30b0c65c..10c55431 100644 --- a/modules-available/vmstore/inc/vmstorebenchmark.inc.php +++ b/modules-available/vmstore/inc/vmstorebenchmark.inc.php @@ -3,6 +3,8 @@ class VmStoreBenchmark { + const PROP_LIST_KEY = 'vmstore.benchmark'; + /** * @param string[] $machineUuids List of UUIDs * @return void @@ -16,8 +18,8 @@ class VmStoreBenchmark if ($machines === false) return; $machines = array_column($machines, 'machineuuid'); - $id = mt_rand() . time(); - Session::set('benchmark-' . $id, ['machines' => $machines], 60); + $id = Property::addToList(self::PROP_LIST_KEY, + json_encode(['machines' => $machines]), 60); Util::redirect('?do=vmstore&show=benchmark&action=select&id=' . $id); } @@ -40,6 +42,9 @@ class VmStoreBenchmark // As of 2022, RemoteExec processes 4 clients in parallel $start = ceil(count($clients) / 4 + 5 + time()); $nfsOpt = $nfs ? '--nfs' : ''; + // We fork off the benchmark into the background, and collect the results with another RemoteExec job + // when we're done. This is because RemoteExec only does four concurrent SSH connections, so if we wanted to + // do this the easy, synchronous way, we never could run more than four tests at the same time. $command = << /dev/null < /dev/null -- cgit v1.2.3-55-g7522