Conversation
There was a problem hiding this comment.
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
Outdated
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
41641d2 to
2bc366d
Compare
gateway/sds_gateway/static/js/visualizations/waterfall/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallSliceLoader.js
Outdated
Show resolved
Hide resolved
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallRenderer.js
Show resolved
Hide resolved
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallVisualization.js
Outdated
Show resolved
Hide resolved
gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallSliceLoader.test.js
Show resolved
Hide resolved
3fb44b3 to
0bb84a2
Compare
gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallVisualization.js
Show resolved
Hide resolved
|
I pushed that commit to cancel pending requests using the controllers (not just remove the promises). Go ahead and pull the change, then see if you can address the other comments and we can merge it. |
lucaspar
left a comment
There was a problem hiding this comment.
thanks; rebase and merge if there are no conflicts, then let's try some visualizations
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