summaryrefslogtreecommitdiffstats
path: root/modules-available/vmstore/inc/vmstorebenchmark.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-07-04 16:58:45 +0200
committerSimon Rettberg2022-07-04 16:58:45 +0200
commit7d2d1c6cdc984b5c25ab6b3a40bd6614b17d0ef9 (patch)
treebd681df91c273ea44bbbc8ab059e0633ca8db346 /modules-available/vmstore/inc/vmstorebenchmark.inc.php
parent[rebootcontrol/main] Add subkey column to property_list table (diff)
downloadslx-admin-7d2d1c6cdc984b5c25ab6b3a40bd6614b17d0ef9.tar.gz
slx-admin-7d2d1c6cdc984b5c25ab6b3a40bd6614b17d0ef9.tar.xz
slx-admin-7d2d1c6cdc984b5c25ab6b3a40bd6614b17d0ef9.zip
[vmstore/main] Use property list for results so they work cross-session
Diffstat (limited to 'modules-available/vmstore/inc/vmstorebenchmark.inc.php')
-rw-r--r--modules-available/vmstore/inc/vmstorebenchmark.inc.php9
1 files changed, 7 insertions, 2 deletions
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 = <<<COMMAND
(
exec &> /dev/null < /dev/null