diff --git a/apps/api/src/endpoints/tokens/token.service.ts b/apps/api/src/endpoints/tokens/token.service.ts index 9cd5adc..1aa99a4 100644 --- a/apps/api/src/endpoints/tokens/token.service.ts +++ b/apps/api/src/endpoints/tokens/token.service.ts @@ -15,6 +15,8 @@ export class TokenService { } async findAll(): Promise { - 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(); } } diff --git a/apps/api/src/endpoints/users/user.service.ts b/apps/api/src/endpoints/users/user.service.ts index a6df6bd..2e9d85a 100644 --- a/apps/api/src/endpoints/users/user.service.ts +++ b/apps/api/src/endpoints/users/user.service.ts @@ -20,6 +20,7 @@ export class UsersService { } async findAll(): Promise { + await new Promise((resolve) => setTimeout(resolve, 500)); // introduced a delay so we can see performance degradation return await this.usersRepository.find(); } diff --git a/k6/compare-results.js b/k6/compare-results.js index 5e435c6..ec05472 100644 --- a/k6/compare-results.js +++ b/k6/compare-results.js @@ -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') {