summaryrefslogtreecommitdiffstats
path: root/modules-available/vmstore/inc/vmstorebenchmark.inc.php
diff options
context:
space:
mode:
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