-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Database Template] Enhance Health Function #200
Conversation
@H0llyW00dzZ I like this idea. Before accepting the PR though we would need to have it implemented for all the database options. |
@briancbarrow I will need to test it one by one for other databases, as my current implementation supports MySQL using the github.com/go-sql-driver/mysql driver. |
@briancbarrow @Ujstor CI error again |
Yeah, unfortunately we'll need to test each one individually. Time consuming but necessary. |
@briancbarrow Only MongoDB and Redis need to be tested, as other databases support calling |
bump another example how it work about this: 2024/04/07 18:03:42 [H0llyW00dzZ Project] [VISITOR] Method: GET, Activity: viewed the health of the database - IP: *********, User-Agent: *********** ******** ** ***** ****** **** ****************** ******* **** ****** **************** *************
2024/04/07 18:03:43 [H0llyW00dzZ Project] [INFO] Database Status: It's healthy, Stats: Open Connections: 1, In Use: 0, Idle: 1, Wait Count: 0, Wait Duration: 0s Note The format containing |
- [+] feat(mysql.tmpl): enhance Health function with comprehensive database connection statistics
- [+] fix(mysql.tmpl): update 'message' field in Health() to display actual error message instead of static text
- [+] feat(postgres.tmpl): enhance Health function to return detailed database statistics and health messages
- [+] refactor(dbdriver): remove redundant error message in Health function for both mysql and postgres templates
- [+] feat(postgres.tmpl): import strconv package - [+] fix(postgres.tmpl): remove unnecessary trailing line at the end of the file
- [+] feat(sqlite.tmpl): enhance Health method with detailed database statistics and health messages
- [+] style(mysql.tmpl): add newline at end of file
This reverts commit f40ad89.
- [+] style(sqlite.tmpl): add newline at end of file
- [+] fix(dbdriver): lower threshold for heavy load message from 90 to 40 in mysql, postgres and sqlite templates
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Problem/Feature
Enhance Health function with comprehensive database connection statistics
Description of Changes:
This is an example where I am using the Fiber framework.
Checklist