Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/api/src/endpoints/tokens/token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export class TokenService {
}

async findAll(): Promise<Token[]> {
return await this.tokenModel.find().exec();
await Promise.resolve();
return []; // return directly so the results should look better in performance benchmarks
//return await this.tokenModel.find().exec();
}
}
1 change: 1 addition & 0 deletions apps/api/src/endpoints/users/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class UsersService {
}

async findAll(): Promise<User[]> {
await new Promise((resolve) => setTimeout(resolve, 500)); // introduced a delay so we can see performance degradation
return await this.usersRepository.find();
}

Expand Down
4 changes: 2 additions & 2 deletions k6/compare-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function extractMetrics(metrics) {
function generateTable(baseCommitHash, baseData, targetCommitHash, targetData) {
let table = `k6 load testing comparison.\nBase Commit Hash: ${baseCommitHash}\nTarget Commit Hash: ${targetCommitHash}\n`;
table += `Test duration: ${baseData['Test Run Duration'].toFixed(2)} ms (base) | ${targetData['Test Run Duration'].toFixed(2)} ms (target) \n\n`;
table += '| Endpoint \ Metric | Average | Max | p(90) | p(95) |\n';
table += '| ----------------- | ---- | ------ | ----- | ----- |\n';
table += '| Endpoint \\ Metric | Average | Max | p(90) | p(95) |\n';
table += '| ------------------ | ---- | ------ | ----- | ----- |\n';

for (const key of Object.keys(baseData)) {
if (key === 'Test Run Duration') {
Expand Down