-
Notifications
You must be signed in to change notification settings - Fork 370
Refine metrics logs #817
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
Refine metrics logs #817
Conversation
a717171
to
dedf01e
Compare
dedf01e
to
9fc23a0
Compare
9fc23a0
to
6fda1a3
Compare
Signed-off-by: haitwang-cloud <[email protected]>
6fda1a3
to
5d0e7c5
Compare
This pull request includes several changes aimed at improving logging, refactoring code for better readability, and enhancing test coverage. The most important changes include updating logging statements to use structured logging, refactoring code for clarity, and adding new test cases. Logging Improvements:
Code Refactoring:
Test Enhancements:
These changes collectively enhance the robustness, readability, and maintainability of the codebase while providing more detailed and structured logging for easier debugging and monitoring. |
Appending the scheduler logs after this PR's fix
|
Thanks:) /lgtm |
What type of PR is this?
/kind design
What this PR does / why we need it:
This pull request includes several changes aimed at improving logging, refactoring code for better readability, and enhancing test coverage. The most important changes include updating logging statements to use structured logging, refactoring code for clarity, and adding new test cases.
Logging Improvements:
cmd/scheduler/metrics.go
: Updated logging statements to useklog.InfoS
for structured logging and added more detailed log messages for better traceability. [1] [2]pkg/scheduler/pods.go
: Enhanced logging inpodManager
methods to provide more context and use structured logging. [1] [2]pkg/scheduler/scheduler.go
: Improved logging inScheduler
methods to use structured logging and added more detailed log messages. [1] [2] [3]Code Refactoring:
pkg/util/client/client.go
: Refactored the client initialization to use a singleton pattern withsync.Once
and improved error handling. [1] [2]Test Enhancements:
pkg/scheduler/scheduler_test.go
: Added new test cases to improve coverage and ensure proper handling of node annotations, including cases with nil annotations. [1] [2]These changes collectively enhance the robustness, readability, and maintainability of the codebase while providing more detailed and structured logging for easier debugging and monitoring.
Which issue(s) this PR fixes:
Fixes # Avoid the client init error by adding ut & singleton pattern
Special notes for your reviewer:
Does this PR introduce a user-facing change?: