use tenants for fixtures
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
54
tests/benchmark/user_list.js
Executable file → Normal file
54
tests/benchmark/user_list.js
Executable file → Normal file
@ -7,51 +7,59 @@ export const options = {
|
||||
discardResponseBodies: true,
|
||||
scenarios: Object.fromEntries(
|
||||
[
|
||||
[10, 20],
|
||||
[100, 20],
|
||||
[1000, 20],
|
||||
[10000, 20],
|
||||
[10, 100],
|
||||
[100, 100],
|
||||
[1000, 100],
|
||||
[10000, 100],
|
||||
// Number of users, number of groups per user, number of parents per group, page size
|
||||
[10, 0, 0, 20],
|
||||
[100, 0, 0, 20],
|
||||
[1000, 0, 0, 20],
|
||||
[10000, 0, 0, 20],
|
||||
[10, 0, 0, 100],
|
||||
[100, 0, 0, 100],
|
||||
[1000, 0, 0, 100],
|
||||
[10000, 0, 0, 100],
|
||||
[10, 20, 0, 20],
|
||||
[100, 20, 0, 20],
|
||||
[1000, 20, 0, 20],
|
||||
[10000, 20, 0, 20],
|
||||
[10, 20, 10, 20],
|
||||
[100, 20, 10, 20],
|
||||
[1000, 20, 10, 20],
|
||||
[10000, 20, 10, 20],
|
||||
].map((obj, i) => [
|
||||
`${obj[0]}_${obj[1]}`,
|
||||
`${obj[0]}_${obj[1]}_${obj[2]}_${obj[3]}`,
|
||||
{
|
||||
executor: "constant-vus",
|
||||
vus: 10,
|
||||
duration: "10s",
|
||||
startTime: `${10 * i}s`,
|
||||
duration: "30s",
|
||||
startTime: `${30 * i}s`,
|
||||
env: {
|
||||
USER_COUNT: `${obj[0]}`,
|
||||
PAGE_SIZE: `${obj[1]}`,
|
||||
GROUPS_PER_USER: `${obj[1]}`,
|
||||
PARENTS_PER_GROUP: `${obj[2]}`,
|
||||
PAGE_SIZE: `${obj[3]}`,
|
||||
},
|
||||
tags: {
|
||||
user_count: `${obj[0]}`,
|
||||
page_size: `${obj[1]}`,
|
||||
groups_per_user: `${obj[1]}`,
|
||||
parents_per_group: `${obj[2]}`,
|
||||
page_size: `${obj[3]}`,
|
||||
},
|
||||
},
|
||||
]),
|
||||
),
|
||||
};
|
||||
|
||||
export function setup() {
|
||||
command("./create_users.py", ["11000"]);
|
||||
}
|
||||
|
||||
export function teardown() {
|
||||
command("./delete_users.py");
|
||||
}
|
||||
|
||||
export default function () {
|
||||
const user_count = Number(__ENV.USER_COUNT);
|
||||
const groups_per_user = Number(__ENV.GROUPS_PER_USER);
|
||||
const parents_per_group = Number(__ENV.PARENTS_PER_GROUP);
|
||||
const domain = `user-list-${user_count}-${groups_per_user}-${parents_per_group}`;
|
||||
const page_size = Number(__ENV.PAGE_SIZE);
|
||||
const pages = Math.round(user_count / 20);
|
||||
const pages = Math.round(user_count / page_size);
|
||||
let requests = [];
|
||||
for (let page = 1; page <= pages; page++) {
|
||||
requests.push([
|
||||
"GET",
|
||||
`http://localhost:9000/api/v3/core/users/?page=${page}&page_size=${page_size}`,
|
||||
`http://${domain}.localhost:9000/api/v3/core/users/?page=${page}&page_size=${page_size}`,
|
||||
null,
|
||||
{
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user