Skip to content
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

Adding bandwith measurement to downloadCutout #9

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

mtauraso
Copy link
Collaborator

  • Stats tracking of timing, data size, and bandwidth for cutout transfer
  • Ability to specify an arbitrary list of filters to the downloader
  • Configurable offset and extent for downloading from a large .fits catalog
  • download() helper function codepath now supports kwargs passed from download() -> _download() -> _download_chunk() -> urllib.request.urlopen()
  • Timout and chunk size for downloadCutout.py are configurable via this kwargs system.

- Placeholder config for download verb
- Stats tracking of timing, data size, and bandwidth for cutout transfer
- Ability to specify an arbitrary list of filters to the downloader
- Configurable offset and extent for downloading from a large .fits catalog
- download() helper function codepath now supports kwargs passed from
  download() -> _download() -> _download_chunk() -> urllib.request.urlopen()
- Timout and chunk size for downloadCutout.py are configurable via this kwargs system.
@mtauraso mtauraso self-assigned this Aug 12, 2024
Copy link

github-actions bot commented Aug 12, 2024

Before [0cd1e6c] After [181a36b] Ratio Benchmark (Parameter)
2.81±0.5s 2.80±1s 1 benchmarks.time_computation
3.68k 3.14k 0.85 benchmarks.mem_list

Click here to view all benchmarks.

# TODO: See if this sort is performed by downloadCutouts
# It appears downloadCutouts is doing some sorting prior to download, but
# unclear if it is the same sort
locations.sort(variable_fields)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This sorting turned out to be unnecessary.

The Rect class in downloadCutout.py has a very particular sort order imposed on it, and the download codepath calls Rect.explode() under the hood, which calls .sort() on a list of Rects particular to each request. This results in the server receiving lists sorted by Tract, RA, DEC and some other fields.

@@ -118,11 +120,77 @@ def create_rects(locations: Table, offset: int = 0, default: dC.Rect = None) ->
return rects


stats = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This whole stats subsystem is pretty hacky. I've tried to make it unobtrusive to the CLI, but if we end up using it for anything beyond spot checks, we likely want to go find ourselves a library to do this.

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 6.89%. Comparing base (0cd1e6c) to head (db26056).

Files Patch % Lines
src/fibad/download.py 0.00% 33 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main      #9      +/-   ##
========================================
- Coverage   9.83%   6.89%   -2.94%     
========================================
  Files          6       6              
  Lines         61      87      +26     
========================================
  Hits           6       6              
- Misses        55      81      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@drewoldag drewoldag left a comment

Choose a reason for hiding this comment

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

This seems plenty fine to me!

@mtauraso mtauraso merged commit b66d834 into main Aug 12, 2024
7 of 9 checks passed
@mtauraso mtauraso deleted the downloader-bandwidth-measure branch August 12, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants