diff options
| author | Stefan Boberg <[email protected]> | 2025-10-10 14:23:19 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2025-10-10 14:23:19 +0200 |
| commit | 922c368b2614c7b25de56757ad6565d0454675cf (patch) | |
| tree | 8ca21a9c1bed6422dc2d0ddb0586f58ff568b3d1 /src | |
| parent | time for test zenserver launches (diff) | |
| download | zen-922c368b2614c7b25de56757ad6565d0454675cf.tar.xz zen-922c368b2614c7b25de56757ad6565d0454675cf.zip | |
minor tweak to overall timing
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenmaster/zenmaster.cpp | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/zenmaster/zenmaster.cpp b/src/zenmaster/zenmaster.cpp index 64f04cf1e..22a2e12b0 100644 --- a/src/zenmaster/zenmaster.cpp +++ b/src/zenmaster/zenmaster.cpp @@ -329,8 +329,6 @@ main(int argc, char** argv) // Spawn some zenserver processes - Stopwatch StartTimer; - zen::ZenServerEnvironment TestEnv; std::filesystem::path ProgramBaseDir = GetRunningExecutablePath().parent_path(); @@ -351,30 +349,30 @@ main(int argc, char** argv) std::vector<std::unique_ptr<ZenServerInstance>> Instances; - TimedBlock("Spawning instances", [&] { - for (int i = 0; i < SpawnCount; ++i) - { - auto& Instance = Instances.emplace_back(std::make_unique<ZenServerInstance>(TestEnv)); + TimedBlock(fmt::format("Spawning {} instances", SpawnCount), [&] { + TimedBlock("Spawning instances", [&] { + for (int i = 0; i < SpawnCount; ++i) + { + auto& Instance = Instances.emplace_back(std::make_unique<ZenServerInstance>(TestEnv)); - std::filesystem::path TestDir1 = TestEnv.CreateNewTestDir(); - Instance->SetTestDir(TestDir1); - Instance->SpawnServer("--malloc=ansi"); - } - }); + std::filesystem::path TestDir1 = TestEnv.CreateNewTestDir(); + Instance->SetTestDir(TestDir1); + Instance->SpawnServer("--malloc=ansi"); + } + }); - TimedBlock("Waiting for instances", [&] { - for (int i = 0; i < SpawnCount; ++i) - { - auto& Instance = Instances[i]; + TimedBlock("Waiting for instances", [&] { + for (int i = 0; i < SpawnCount; ++i) + { + auto& Instance = Instances[i]; - const uint16_t PortNum = Instance->WaitUntilReady(); + const uint16_t PortNum = Instance->WaitUntilReady(); - ZEN_INFO("Instance #{} UP - port {}", i, PortNum); - } + ZEN_INFO("Instance #{} UP - port {}", i, PortNum); + } + }); }); - ZEN_INFO("Starting {} instances took {}", SpawnCount, NiceTimeSpanMs(StartTimer.GetElapsedTimeMs())); - ZEN_INFO("press any key to tear instances down"); zen::getch(); |