Skip to content

Commit

Permalink
Bump up prom-client dependency (#52)
Browse files Browse the repository at this point in the history
* Bump up prom-client dependency

- Release notes - https://github.com/siimon/prom-client/releases
- There are no breaking changes in prom-client other than dropping
support for older nodejs versions.
- We can get benefitted from the performance improvements done.

* Empty-Commit

* Add comma suffix in the hash map keys

* Remove log

---------

Co-authored-by: Tushar Choudhari <tushar@last9.io>
  • Loading branch information
prathamesh-sonpatki and chtushar authored May 20, 2024
1 parent 7a84044 commit 554085d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
31 changes: 23 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@types/supertest": "^6.0.2",
"chalk": "^4.1.2",
"chokidar": "^3.6.0",
"prom-client": "^14.2.0",
"prom-client": "^15.1.2",
"response-time": "^2.3.2",
"rollup": "^4.14.3",
"undici": "^5.27.2",
Expand Down
7 changes: 7 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ runPrismaTests() {
npm run vitest -t ./tests/prisma/*.test.ts
}

# Run MySQL tests
runMysqlTests() {
npm run vitest -t ./tests/mysql2.test.ts
}

# Check if a variable is passed
if [ "$1" = "express" ]; then
npm run vitest -t ./tests/express.test.ts
Expand All @@ -47,6 +52,8 @@ elif [ "$1" = "nestjs" ]; then
runNestJsTests
elif [ "$1" = "prisma" ]; then
runPrismaTests
elif [ "$1" = "mysql2" ]; then
runAllTests
else
runAllTests
fi
8 changes: 4 additions & 4 deletions tests/mysql2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('mysql2', () => {
expect(
// @ts-ignore
histogram.hashMap[
'database_name:test_db,query:SELECT * FROM users;,status:success'
'database_name:test_db,query:SELECT * FROM users;,status:success,'
]?.count
).toBe(NUMBER_OF_REQUESTS);
});
Expand All @@ -105,7 +105,7 @@ describe('mysql2', () => {
expect(
// @ts-ignore
histogram.hashMap[
'database_name:test_db,query:SELECT * FROM user;,status:failure'
'database_name:test_db,query:SELECT * FROM user;,status:failure,'
]?.count
).toBe(NUMBER_OF_REQUESTS);
});
Expand All @@ -126,7 +126,7 @@ describe('mysql2', () => {
expect(
// @ts-ignore
histogram.hashMap[
'database_name:test_db,query:SELECT * FROM users;,status:success'
'database_name:test_db,query:SELECT * FROM users;,status:success,'
]?.count
).toBe(NUMBER_OF_REQUESTS * 2);
});
Expand All @@ -143,7 +143,7 @@ describe('mysql2', () => {
expect(
// @ts-ignore
histogram.hashMap[
'database_name:test_db,query:SELECT * FROM users;,status:success'
'database_name:test_db,query:SELECT * FROM users;,status:success,'
]?.count
).toBe(NUMBER_OF_REQUESTS * 2);
});
Expand Down

0 comments on commit 554085d

Please sign in to comment.