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

Feature: add ODR monitoring module #34

Merged

Conversation

robert-cronin
Copy link
Contributor

Fixes #13

I believe I covered all the bases here, but if I've missed anything please don't hesitate to suggest improvements or fixes!

[x] odr_monitoring module is created and integrated into the project structure
[x] Logging system is implemented and configurable
[x] Other modules can easily use the logging functionality
[x] Basic error and info logging are functional
[x] Configuration options for logging are available and documented
[x] Placeholder for future performance monitoring is in place
[x] Tests are written and passing
[x] Documentation for usage and configuration is available

As for testing, I'm not sure if there has been any agreement for min coverage for new features? I am getting 87% but I can strengthen if need be!

Thank you in advance for your review!

@robert-cronin robert-cronin force-pushed the feature/odr_monitoring branch from 1e4211b to 4c86dd6 Compare August 28, 2024 09:25
@robert-cronin
Copy link
Contributor Author

robert-cronin commented Aug 28, 2024

I've just noticed that there is another logger method in api module, so I might have misinterpreted the first criterion. @fearnworks was the intention to replace all project logging with this central monitoring module as a part of this change?

@robert-cronin robert-cronin force-pushed the feature/odr_monitoring branch from 4c86dd6 to c5bb1bc Compare August 28, 2024 09:34
@fearnworks
Copy link
Collaborator

As far as coverage I don't think we are setting minimum coverage, just that we can prove out the critical path for now.

Irt second comment : Replacing all of the logging isn't required for this feature since that could spiral out of hand. As long as the logs are available to be used in the other components.

@fearnworks
Copy link
Collaborator

I get this error when running task monitoring:test :

_________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestODRLogger.test_logger_creation __________________________________________________________________________________________________________________________________________________________________________________________________________________________ 

self = <tests.test_logger.TestODRLogger testMethod=test_logger_creation>

    def tearDown(self):
        if os.path.exists(self.log_file):
>           os.remove(self.log_file)
E           PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'logs/odr_monitoring.log'

tests\test_logger.py:46: PermissionError
=============================================================================================================================================================================================================================== short test summary info =============================================================================================================================================================================================================================== 
FAILED tests/test_logger.py::TestODRLogger::test_log_format - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'logs/odr_monitoring.log'
FAILED tests/test_logger.py::TestODRLogger::test_log_levels - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'logs/odr_monitoring.log'
FAILED tests/test_logger.py::TestODRLogger::test_logger_creation - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'logs/odr_monitoring.log'
================================================================================================================================================================================================================================== 3 failed in 0.17s ================================================================================================================================================================================================================================== 
task: Failed to run task "monitoring:test": exit status 1

Test outputs look good! Just likely need to make sure the file is released before teardown

@robert-cronin
Copy link
Contributor Author

I get this error when running task monitoring:test :

_________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestODRLogger.test_logger_creation __________________________________________________________________________________________________________________________________________________________________________________________________________________________ 

self = <tests.test_logger.TestODRLogger testMethod=test_logger_creation>

    def tearDown(self):
        if os.path.exists(self.log_file):
>           os.remove(self.log_file)
E           PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'logs/odr_monitoring.log'

tests\test_logger.py:46: PermissionError
=============================================================================================================================================================================================================================== short test summary info =============================================================================================================================================================================================================================== 
FAILED tests/test_logger.py::TestODRLogger::test_log_format - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'logs/odr_monitoring.log'
FAILED tests/test_logger.py::TestODRLogger::test_log_levels - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'logs/odr_monitoring.log'
FAILED tests/test_logger.py::TestODRLogger::test_logger_creation - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'logs/odr_monitoring.log'
================================================================================================================================================================================================================================== 3 failed in 0.17s ================================================================================================================================================================================================================================== 
task: Failed to run task "monitoring:test": exit status 1

Test outputs look good! Just likely need to make sure the file is released before teardown

Good catch, I think you're right, we just need to release the file before teardown, I'll push a fix 👍

Copy link
Collaborator

@fearnworks fearnworks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks solid. Very minor update request for the module imports

version: "3"

tasks:
default:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice. Making a mental note to propogate to the other task files

Copy link
Contributor Author

@robert-cronin robert-cronin Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah its a cool pattern I've adopted recently, I think it just gets rid of the error upon running task

@robert-cronin robert-cronin force-pushed the feature/odr_monitoring branch from c5bb1bc to a017ae8 Compare August 28, 2024 10:02
@robert-cronin
Copy link
Contributor Author

@fearnworks latest change should fix the PR comments, don't hesitate to add more if needed, thanks!

@fearnworks
Copy link
Collaborator

LGTM. Tests pass. Output looks solid. Nice work! Merging

@fearnworks fearnworks merged commit d2b30e9 into Open-Model-Initiative:main Aug 28, 2024
2 checks passed
@hipsterusername
Copy link
Contributor

Hey @robert-cronin - shoot us a note on discord!

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.

Bootstrap Monitoring / Logging System
3 participants