diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenmaster/zenmaster.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/zenmaster/zenmaster.cpp b/src/zenmaster/zenmaster.cpp index 22a2e12b0..02c01fc50 100644 --- a/src/zenmaster/zenmaster.cpp +++ b/src/zenmaster/zenmaster.cpp @@ -200,6 +200,9 @@ main(int argc, char** argv) Options.add_options()("malloc", "Configure memory allocator subsystem", cxxopts::value(MemoryOptions)->default_value("mimalloc")); Options.add_options()("help", "Show command line help"); + int ServerSpawnCount = 100; + Options.add_options()("count", "Number of servers to spawn", cxxopts::value<int>(ServerSpawnCount)); + #if ZEN_WITH_TRACE // We only have this in options for command line help purposes - we parse these argument separately earlier using // GetTraceOptionsFromCommandline() @@ -345,13 +348,11 @@ main(int argc, char** argv) ZEN_INFO("END {}, took {}", Tag, NiceTimeSpanMs(t.GetElapsedTimeMs())); }; - int SpawnCount = 100; - std::vector<std::unique_ptr<ZenServerInstance>> Instances; - TimedBlock(fmt::format("Spawning {} instances", SpawnCount), [&] { + TimedBlock(fmt::format("Spawning {} instances", ServerSpawnCount), [&] { TimedBlock("Spawning instances", [&] { - for (int i = 0; i < SpawnCount; ++i) + for (int i = 0; i < ServerSpawnCount; ++i) { auto& Instance = Instances.emplace_back(std::make_unique<ZenServerInstance>(TestEnv)); @@ -362,7 +363,7 @@ main(int argc, char** argv) }); TimedBlock("Waiting for instances", [&] { - for (int i = 0; i < SpawnCount; ++i) + for (int i = 0; i < ServerSpawnCount; ++i) { auto& Instance = Instances[i]; @@ -377,7 +378,7 @@ main(int argc, char** argv) zen::getch(); TimedBlock("Shutting down instances", [&] { - for (int i = 0; i < SpawnCount; ++i) + for (int i = 0; i < ServerSpawnCount; ++i) { auto& Instance = Instances[i]; |