-
Notifications
You must be signed in to change notification settings - Fork 0
Add waterfall streaming functionality with tests and linting fixes #247
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR implements on-demand streaming functionality for waterfall visualizations, eliminating lengthy preprocessing times by computing FFTs in real-time as needed. The implementation adds a caching layer with intelligent prefetching to ensure smooth user experience.
Changes:
- Added streaming API endpoints (
waterfall_metadata_streamandwaterfall_slices_stream) that compute FFT on-demand without preprocessing - Implemented persistent DRF file caching in
MEDIA_ROOT/drf_cacheto avoid repeated downloads from MinIO - Added JavaScript components for LRU slice caching (
WaterfallSliceCache) and intelligent batch loading with retry logic (WaterfallSliceLoader)
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
gateway/sds_gateway/visualizations/processing/waterfall.py |
Added on-demand slice computation functions and fixed FFT shift bug for correct frequency display |
gateway/sds_gateway/visualizations/processing/utils.py |
Implemented persistent DRF cache with helper functions for cache lookup and reconstruction |
gateway/sds_gateway/api_methods/views/capture_endpoints.py |
Added three new endpoints: waterfall_slices, waterfall_metadata_stream, waterfall_slices_stream with validation |
gateway/sds_gateway/api_methods/tests/test_capture_endpoints.py |
Added comprehensive tests for waterfall_slices endpoint covering authentication, validation, and edge cases |
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallSliceCache.js |
New LRU cache implementation for waterfall slices with eviction policies |
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallSliceLoader.js |
New API loader with batching, retry logic, request deduplication, and debouncing |
gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallSliceLoader.test.js |
Comprehensive Jest tests for slice loader covering all major functionality |
gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallSliceCache.test.js |
Jest tests for cache implementation including LRU eviction and edge cases |
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallVisualization.js |
Integrated streaming mode with fallback to preprocessed data, added loading states and prefetching |
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallRenderer.js |
Added loading placeholder rendering for missing slices during streaming |
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallControls.js |
Added loading state management for scroll buttons |
gateway/sds_gateway/static/js/visualizations/waterfall/PeriodogramChart.js |
Fixed frequency axis calculation to include center frequency offset |
gateway/sds_gateway/static/js/visualizations/waterfall/constants.js |
Added cache, batch, and prefetch strategy constants |
gateway/sds_gateway/static/js/visualizations/waterfall/index.js |
Added imports for new cache and loader modules |
gateway/sds_gateway/context_processors.py |
Added context processor to expose VISUALIZATIONS_ENABLED setting |
gateway/config/settings/base.py |
Registered new context processor |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gateway/sds_gateway/static/js/visualizations/waterfall/constants.js
Outdated
Show resolved
Hide resolved
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallVisualization.js
Show resolved
Hide resolved
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallSliceLoader.js
Outdated
Show resolved
Hide resolved
gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallSliceLoader.test.js
Outdated
Show resolved
Hide resolved
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallVisualization.js
Outdated
Show resolved
Hide resolved
19ec509 to
d69dc6e
Compare
Summary
Implements on-demand streaming for waterfall visualizations, eliminating the need for lengthy preprocessing times. Added test
https://crc-dev.atlassian.net/jira/software/c/projects/SFDS/boards/87?selectedIssue=SFDS-280