-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dev): added random_user.lua for benchamarking purposes
- Loading branch information
1 parent
9daebd4
commit 2e5e0b9
Showing
4 changed files
with
63 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-- wrk.lua | ||
|
||
-- Function to generate random strings | ||
function getAlphaChar() | ||
selection = math.random(1, 3) | ||
if selection == 1 then return string.char(math.random(65, 90)) end | ||
if selection == 2 then return string.char(math.random(97, 122)) end | ||
return string.char(math.random(48, 57)) | ||
end | ||
|
||
-- Function to generate random strings | ||
function randomString(length) | ||
length = length or 1 | ||
if length < 1 then return nil end | ||
local array = {} | ||
for i = 1, length do | ||
array[i] = getAlphaChar() | ||
end | ||
return table.concat(array) | ||
end | ||
|
||
-- Function to remove trailing slashes | ||
function removeTrailingSlash(s) | ||
return (s:gsub("(.-)/*$", "%1")) | ||
end | ||
|
||
-- Function to generate random emails | ||
function randomEmail(domain) | ||
return randomString(24) .. "@" .. domain | ||
end | ||
|
||
request = function() | ||
wrk.method = "POST" | ||
wrk.body = "username=" .. randomString(24) .. | ||
"&email=" .. randomEmail("example.com") .. | ||
"&password=" .. randomString(12) .. | ||
"&strategy=PASSWORD" | ||
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded" | ||
|
||
return wrk.format(nil, nil, wrk.headers, wrk.body) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
version: '3.8' | ||
|
||
services: | ||
db: | ||
image: postgres:15 | ||
restart: always | ||
environment: | ||
- POSTGRES_DB=zenei_db | ||
- POSTGRES_USER=zenei_user | ||
- POSTGRES_PASSWORD=zenei_password | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
|
||
zenei-auth: | ||
image: ghcr.io/cloudeko/services/native/zenei:a494bcb | ||
image: ghcr.io/cloudeko/services/native/zenei:9daebd4 | ||
restart: always | ||
depends_on: | ||
- db | ||
volumes: | ||
- ./dev/dev-private-key.pem:/app/dev-private-key.pem | ||
- ./dev/dev-public-key.pem:/app/dev-public-key.pem | ||
- ./dev/dev-private-key.pem:/key/dev-private-key.pem | ||
- ./dev/dev-public-key.pem:/key/dev-public-key.pem | ||
ports: | ||
- 8080:8080 | ||
environment: | ||
- quarkus.application.name=cloudeko-zenei-auth-service | ||
- quarkus.datasource.db-kind=postgresql | ||
- quarkus.datasource.jdbc.url=jdbc:postgresql://db:5432/zenei_db | ||
- quarkus.datasource.jdbc.driver=org.postgresql.Driver | ||
- quarkus.datasource.username=zenei_user | ||
- quarkus.datasource.password=zenei_password | ||
- quarkus.hibernate-orm.database.generation=update | ||
- smallrye.jwt.sign.key.location=dev-private-key.pem | ||
- mp.jwt.verify.publickey.location=dev-public-key.pem | ||
- smallrye.jwt.sign.key.location=/key/dev-private-key.pem | ||
- mp.jwt.verify.publickey.location=/key/dev-public-key.pem | ||
- mp.jwt.verify.issuer=https://example.com/issuer | ||
- quarkus.mailer.mock=true | ||
|
||
db: | ||
image: postgres:14 | ||
restart: always | ||
environment: | ||
- POSTGRES_DB=zenei_db | ||
- POSTGRES_USER=zenei_user | ||
- POSTGRES_PASSWORD=zenei_password | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
|
||
volumes: | ||
postgres_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters