Skip to content
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

feat/sqlx_metric #4587

Merged
merged 1 commit into from
Jan 22, 2025
Merged

feat/sqlx_metric #4587

merged 1 commit into from
Jan 22, 2025

Conversation

MarkJoyMa
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 94.55%. Comparing base (8690859) to head (b974c36).
Report is 223 commits behind head on master.

Files with missing lines Patch % Lines
core/stores/sqlx/sqlmanager.go 0.00% 11 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
core/stores/sqlx/sqlmanager.go 50.00% <0.00%> (-17.75%) ⬇️

... and 8 files with indirect coverage changes

@kevwan
Copy link
Contributor

kevwan commented Jan 19, 2025

Review Comments:

  1. Error Handling:

    • The error from mysql.ParseDSN is silently ignored with a comment "do nothing here"
    • Consider logging the error or handling it more explicitly
  2. Security Consideration:

    • Good practice using SHA-256 for hashing the server string to avoid exposing sensitive connection details in metrics
  3. Code Style:

    • The code follows the project's style guidelines
    • The changes are well-structured and easy to understand
  4. Potential Improvements:

    • Consider adding documentation for the new metrics collection feature
    • Could add comments explaining the purpose of the hash and why it's needed
    • The error handling for ParseDSN could be more explicit

The PR appears to be a useful addition that adds metrics collection capabilities for MySQL connections, which would help in monitoring and debugging database connection pools. However, I would recommend:

  1. Adding documentation about the new metrics collection feature
  2. Improving the error handling for the DSN parsing
  3. Adding tests for the new functionality

@kevwan kevwan added this pull request to the merge queue Jan 22, 2025
Merged via the queue into zeromicro:master with commit 030c859 Jan 22, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants