From fd65fdd72543ca6b98b4c8890bdcee61336b2656 Mon Sep 17 00:00:00 2001 From: SlashLight <99999386+SlashLight@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:01:50 +0300 Subject: [PATCH] Create req.lua --- perf_test/req.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 perf_test/req.lua diff --git a/perf_test/req.lua b/perf_test/req.lua new file mode 100644 index 0000000..025ba53 --- /dev/null +++ b/perf_test/req.lua @@ -0,0 +1,14 @@ +math.randomseed(os.time()) +local counter = 0 +-- Генерируем уникального пользователя +function request() + local user_id = math.random(1000, 999999) + local first_name = "fname" .. user_id .. counter + local last_name = "lname" .. user_id .. counter + local email = first_name .. last_name .. "@example.com" + local password = "qwerty12345" + + -- Тело запроса + local body = string.format('{"first_name":"%s", "last_name":"%s", "password":"%s", "email":"%s"}', first_name, last> counter = counter + 1 + return wrk.format("POST", "/api/v1/auth/register", {["Content-Type"] = "application/json"}, body) +end