Feature/64 create framework for benchmarking#66
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a CPU and RAM monitoring system for benchmarking the main pipeline execution. The monitoring decorator samples resource usage during runs, logs data locally and to Azure blob storage. Additionally, it refactors DataFrame-to-bytes conversion to consistently use Parquet format across the codebase.
Changes:
- Added a monitoring decorator (
monitor_cpu_and_ram) that samples CPU and RAM usage during pipeline execution, with results saved to local files and uploaded to blob storage - Refactored DataFrame serialization by replacing
convert_df_to_byteswithconvert_df_to_parquet_bytesfor consistent Parquet-based serialization - Updated configuration and dependency injection to support the new monitoring module
Reviewed changes
Copilot reviewed 10 out of 13 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/application/common/monitor.py | New monitoring module with CPU/RAM sampling decorator and helper functions for benchmarking |
| src/application/common/init.py | Exports the new monitor_cpu_and_ram decorator |
| main.py | Applies the monitoring decorator to the main function with a unique run ID |
| src/application/contracts/bytes_service_interface.py | Renames method from convert_df_to_bytes to convert_df_to_parquet_bytes |
| src/infra/infrastructure/services/bytes_service.py | Implements convert_df_to_parquet_bytes using BytesIO and Parquet serialization |
| src/infra/infrastructure/services/release_service.py | Updates to use the new convert_df_to_parquet_bytes method |
| src/presentation/configuration/app_config.py | Wires the monitor module for dependency injection |
| src/presentation/entrypoints/release_pipeline.py | Removes unused Dict import |
| src/config.py | Adds MONITOR_LOG_DIRECTORY configuration |
| src/domain/enums/storage_container.py | Adds BENCHMARKS container enum value |
| requirements.txt | Adds development dependencies (objprint, pandas-stubs, types-pytz, viztracer) and removes platform markers from pywin32/pywinpty |
| .gitignore | Excludes generated monitoring logs (CSV and Parquet files) |
| monitor_logs/.gitkeep | Placeholder for monitoring logs directory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a CPU and RAM monitoring system for the main pipeline execution, refactors DataFrame-to-bytes conversion to use Parquet format, and updates dependency injection and configuration to support these features. The monitoring system logs resource usage during pipeline runs and uploads the results to blob storage for benchmarking and analysis.
Resource monitoring and logging:
monitor_cpu_and_ramdecorator insrc/application/common/monitor.pythat samples process CPU and RAM usage during pipeline execution, logs the data to Parquet and CSV, and uploads results to blob storage in the newbenchmarkscontainer. The decorator is applied to themainfunction inmain.py, generating a uniquerun_idfor each run. [1] [2] [3]MONITOR_LOG_DIRECTORYfor storing local logs.DataFrame serialization improvements:
convert_df_to_byteswithconvert_df_to_parquet_bytes, standardizing on Parquet format for serialization. [1] [2]Minor cleanup:
release_pipeline.py.