-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add Gen3 SDK vs CDIS download performance testing suite #317
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
Open
Dhiren-Mhatre
wants to merge
5
commits into
uc-cdis:master
Choose a base branch
from
Dhiren-Mhatre:feat/gen3_cdis_performance_comparison
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5d9ab33
feat: add Gen3 SDK vs CDIS download performance testing suite
Dhiren-Mhatre a0fca0a
Merge branch 'master' into feat/gen3_cdis_performance_comparison
Avantol13 550d014
addresed feedbacks
Dhiren-Mhatre 1578eb4
Merge branch 'master' into feat/gen3_cdis_performance_comparison
Avantol13 4ad64de
Address review feedback
Dhiren-Mhatre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| # Download Performance Testing Script | ||
|
|
||
| A comprehensive Python script that compares CDIS Data Client and Gen3 SDK download-multiple-async functionality with profiling and monitoring capabilities. | ||
|
|
||
| ## Features | ||
|
|
||
| - **Performance Testing**: Comprehensive async and CDIS performance comparison | ||
| - **Profiling**: Built-in cProfile integration with detailed bottleneck analysis | ||
| - **Real-time Monitoring**: CPU, memory, and resource usage tracking during downloads | ||
| - **HTML Reports**: Interactive HTML reports with charts and detailed metrics | ||
| - **Multiple Test Runs**: Configurable number of runs per method for statistical analysis | ||
| - **Detailed Timing**: Breakdown of setup, download, and verification phases | ||
| - **File Matching**: Intelligent file matching with GUID verification | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Python 3.9+ | ||
| - Poetry for dependency management | ||
| - Gen3 SDK installed via pyproject.toml (see Configuration section) | ||
| - `gen3-client` executable for CDIS testing | ||
|
|
||
| ## Installation | ||
|
|
||
| 1. Install Poetry (if not already installed): | ||
|
|
||
| ```bash | ||
| curl -sSL https://install.python-poetry.org | python3 - | ||
| ``` | ||
|
|
||
| 2. Install dependencies using Poetry: | ||
|
|
||
| ```bash | ||
| poetry install | ||
| ``` | ||
|
|
||
| 3. Activate the virtual environment: | ||
|
|
||
| ```bash | ||
| poetry shell | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Testing a Specific Gen3 SDK Branch | ||
|
|
||
| To test a specific branch of the Gen3 SDK (e.g., a development branch with new features), update your `pyproject.toml` file to install from the desired branch: | ||
|
|
||
| ```toml | ||
| [tool.poetry.dependencies] | ||
| gen3 = {git = "https://github.com/Dhiren-Mhatre/gen3sdk-python", branch = "feat/multiple-download-performance-testing"} | ||
| ``` | ||
|
|
||
| Then update your dependencies: | ||
|
|
||
| ```bash | ||
| poetry lock | ||
| poetry install | ||
| ``` | ||
|
|
||
| ### Other Configuration | ||
|
|
||
| Before running the tests, configure the following: | ||
|
|
||
| 1. **Credentials**: Specify credentials file with `--credentials path/to/credentials.json` | ||
| 2. **Gen3 Client**: Ensure `gen3-client` is in your PATH or specify with `--gen3-client-path` | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Basic Usage | ||
|
|
||
| ```bash | ||
| python download_performance_test.py --manifest test_data/sample_manifest.json | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's replace this with what we typically expect to run. Something like this: |
||
| ``` | ||
|
|
||
| ### Command Line Options | ||
|
|
||
| ```bash | ||
| python download_performance_test.py \ | ||
| --manifest manifest.json \ | ||
| --num-runs 2 \ | ||
| --max-concurrent-async 100 \ | ||
| --num-workers-cdis 4 \ | ||
| --test-methods "async,cdis" \ | ||
| --endpoint "https://data.midrc.org" \ | ||
| --credentials "credentials.json" \ | ||
| --gen3-client-path "gen3-client" \ | ||
| --download-dir "downloads" \ | ||
| --results-dir "download_performance_results" \ | ||
| --disable-profiling \ | ||
| --disable-monitoring \ | ||
| --disable-detailed-timing | ||
| ``` | ||
|
|
||
| ### Available Arguments | ||
|
|
||
| | Argument | Default | Description | | ||
| | --------------------------- | -------------------------------- | ----------------------------------- | | ||
| | `--manifest` | `test_data/sample_manifest.json` | Path to manifest JSON file | | ||
| | `--num-runs` | `2` | Number of test runs per method | | ||
| | `--max-concurrent-async` | `100` (configurable) | Max concurrent requests for async | | ||
| | `--num-workers-cdis` | `4` (configurable) | Number of CDIS workers | | ||
| | `--test-methods` | `"async,cdis"` | Comma-separated test methods | | ||
| | `--endpoint` | `https://data.midrc.org` | Gen3 endpoint URL | | ||
| | `--credentials` | `credentials.json` | Path to credentials file | | ||
| | `--gen3-client-path` | `gen3-client` | Path to gen3-client executable | | ||
| | `--download-dir` | `downloads` | Directory to store downloaded files | | ||
| | `--results-dir` | `download_performance_results` | Directory to store results | | ||
| | `--disable-profiling` | `False` | Disable performance profiling | | ||
| | `--disable-monitoring` | `False` | Disable real-time monitoring | | ||
| | `--disable-detailed-timing` | `False` | Disable detailed timing breakdown | | ||
|
|
||
| ### Test Methods | ||
|
|
||
| - **`cdis`**: Tests CDIS Data Client with worker-based concurrency | ||
| - **`async`**: Tests Gen3 SDK with async/await and semaphore control | ||
|
|
||
| ## Output | ||
|
|
||
| Results are saved to `download_performance_results/`: | ||
|
|
||
| - **HTML Report**: Interactive report with charts (`download_performance_report_YYYYMMDD_HHMMSS.html`) | ||
| - **JSON Results**: Detailed metrics (`enhanced_results_YYYYMMDD_HHMMSS.json`) | ||
| - **Log Files**: Comprehensive test logs (`test_run.log`) | ||
| - **Downloaded Files**: Test files in method-specific directories | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```bash | ||
| # Test both methods with 2 runs each (default) | ||
| python download_performance_test.py \ | ||
| --manifest test_data/sample_manifest.json | ||
|
|
||
| # Test only async method with high concurrency | ||
| python download_performance_test.py \ | ||
| --manifest manifest.json \ | ||
| --test-methods "async" \ | ||
| --max-concurrent-async 500 | ||
|
|
||
| # Quick test with profiling disabled | ||
| python download_performance_test.py \ | ||
| --manifest manifest.json \ | ||
| --num-runs 1 \ | ||
| --disable-profiling \ | ||
| --disable-monitoring | ||
| ``` | ||
|
|
||
| ## What Gets Tested | ||
|
|
||
| - **Download Success Rates**: File-by-file success tracking with GUID verification | ||
| - **Performance Metrics**: Throughput (MB/s), timing breakdown, concurrency efficiency | ||
| - **Resource Usage**: Real-time memory, CPU, and I/O monitoring | ||
| - **Profiling Analysis**: Function-level performance bottlenecks and optimization insights | ||
| - **Scalability**: Performance under different concurrency levels | ||
| - **Error Handling**: Comprehensive error tracking and failure analysis | ||
|
|
||
| ## Performance Insights | ||
|
|
||
| The script provides detailed performance analysis including: | ||
|
|
||
| - Top performance bottlenecks by cumulative time | ||
| - Function call efficiency metrics | ||
| - I/O and network operation analysis | ||
| - Memory and CPU usage patterns | ||
| - Optimization recommendations | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say "Comprehensive Gen3 Python SDK/CLI and Golang Client performance comparison" instead