Skip to content

Commit

Permalink
Create req.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
SlashLight authored Dec 24, 2024
1 parent 89aecb8 commit fd65fdd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions perf_test/req.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fd65fdd

Please sign in to comment.