// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "../zen.h" namespace zen { class BenchPurgeSubCmd : public ZenSubCmdBase { public: BenchPurgeSubCmd(); void Run(const ZenCliOptions& GlobalOptions) override; private: bool m_SingleProcess = false; }; class BenchHttpSubCmd : public ZenSubCmdBase { public: BenchHttpSubCmd(); void Run(const ZenCliOptions& GlobalOptions) override; private: void RunFixedCount(const std::string& BaseUri, const std::string& Path); void RunContinuous(const std::string& BaseUri, const std::string& Path); std::string m_Url; std::string m_SocketPath; int m_Count = 100; int m_Concurrency = 1; std::string m_Method = "GET"; bool m_NoKeepAlive = false; bool m_Continuous = false; }; class BenchCommand : public ZenCmdWithSubCommands { public: static constexpr char Name[] = "bench"; static constexpr char Description[] = "Utility command for benchmarking"; BenchCommand(); ~BenchCommand(); cxxopts::Options& Options() override { return m_Options; } ZenCmdCategory& CommandCategory() const override { return g_UtilitiesCategory; } private: cxxopts::Options m_Options{Name, Description}; std::string m_SubCommand; BenchPurgeSubCmd m_PurgeSubCmd; BenchHttpSubCmd m_HttpSubCmd; }; } // namespace zen