Skip to content

Waterfall streaming#247

Merged
srucker01 merged 19 commits intomasterfrom
sr_stream_data
Mar 12, 2026
Merged

Waterfall streaming#247
srucker01 merged 19 commits intomasterfrom
sr_stream_data

Conversation

@srucker01
Copy link
Collaborator

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

@semanticdiff-com
Copy link

semanticdiff-com bot commented Jan 22, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallControls.js  28% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/PeriodogramChart.js  25% smaller
  gateway/sds_gateway/api_methods/views/capture_endpoints.py  12% smaller
  gateway/config/settings/base.py  12% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallVisualization.js  9% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallRenderer.js  9% smaller
  gateway/sds_gateway/visualizations/processing/waterfall.py  7% smaller
  gateway/sds_gateway/visualizations/processing/utils.py  4% smaller
  gateway/.gitignore Unsupported file format
  gateway/pyproject.toml Unsupported file format
  gateway/sds_gateway/api_methods/tests/test_capture_endpoints.py  0% smaller
  gateway/sds_gateway/api_methods/throttling.py  0% smaller
  gateway/sds_gateway/context_processors.py  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallSliceCache.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallSliceLoader.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallControls.test.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallRenderer.test.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallSliceCache.test.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallSliceLoader.test.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallVisualization.test.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/constants.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/index.js  0% smaller
  gateway/uv.lock Unsupported file format

@lucaspar lucaspar requested a review from Copilot January 22, 2026 18:29
@lucaspar lucaspar added gateway Gateway component javascript Pull requests that update non-trivial javascript code visualization Related to SVI or the visualization component of SDS. labels Jan 22, 2026
Copy link
Contributor

Copilot AI left a 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_stream and waterfall_slices_stream) that compute FFT on-demand without preprocessing
  • Implemented persistent DRF file caching in MEDIA_ROOT/drf_cache to 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.

@srucker01 srucker01 force-pushed the sr_stream_data branch 2 times, most recently from 41641d2 to 2bc366d Compare February 6, 2026 20:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@lucaspar lucaspar changed the title Add waterfall streaming functionality with tests and linting fixes Waterfall streaming Feb 10, 2026
@lucaspar
Copy link
Member

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.

Copy link
Member

@lucaspar lucaspar left a comment

Choose a reason for hiding this comment

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

thanks; rebase and merge if there are no conflicts, then let's try some visualizations

@srucker01 srucker01 merged commit f7e0ce1 into master Mar 12, 2026
2 checks passed
@srucker01 srucker01 deleted the sr_stream_data branch March 12, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway component javascript Pull requests that update non-trivial javascript code visualization Related to SVI or the visualization component of SDS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants