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

Add progress callback for transferred object keys in copy_files_from #192

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

tilman-aiven
Copy link
Contributor

@tilman-aiven tilman-aiven commented Aug 21, 2024

About this change - What it does

This adds a callback function in copy_files_from, which provides the transferred object key with completed and total files.

We want to measure the progress of transferred files. However measuring the amount of transferred bytes requires a provider based implementation. Therefore we measure the keys which is provider independent.

This allows us to hook the key iteration
without an override for each provider transfer.
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.48%. Comparing base (9358041) to head (e030ab6).
Report is 3 commits behind head on main.

Files Patch % Lines
rohmu/object_storage/base.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #192      +/-   ##
==========================================
+ Coverage   73.41%   73.48%   +0.06%     
==========================================
  Files          34       34              
  Lines        4085     4224     +139     
==========================================
+ Hits         2999     3104     +105     
- Misses       1086     1120      +34     

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

Copy link
Contributor

@aris-aiven aris-aiven left a comment

Choose a reason for hiding this comment

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

Small comments, overall looks good

test/object_storage/test_object_storage.py Outdated Show resolved Hide resolved
rohmu/object_storage/base.py Outdated Show resolved Hide resolved
@tilman-aiven tilman-aiven force-pushed the tilman-transfered-object-keys-progress branch from 73ae675 to 9a596fc Compare August 21, 2024 14:58
rohmu/object_storage/base.py Outdated Show resolved Hide resolved
Copy link
Contributor

@joelynch joelynch left a comment

Choose a reason for hiding this comment

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

Few small typing style nits but nothing blocking and looks great

rohmu/object_storage/base.py Outdated Show resolved Hide resolved
rohmu/object_storage/base.py Outdated Show resolved Hide resolved
Added callback progress_fn to copy_files_from
which tracks the progress of transferred objects with completed and total files.

This does not measure the number of bytes
in order to avoid a provider based implementation.
@tilman-aiven tilman-aiven force-pushed the tilman-transfered-object-keys-progress branch from 31f4254 to e030ab6 Compare August 26, 2024 09:20
@tilman-aiven tilman-aiven marked this pull request as ready for review August 27, 2024 07:57
@aris-aiven aris-aiven self-requested a review August 27, 2024 09:45
Copy link
Contributor

@aris-aiven aris-aiven left a comment

Choose a reason for hiding this comment

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

Comments addressed, thank you for the contribution

@aris-aiven aris-aiven merged commit 47d3ed7 into main Aug 27, 2024
9 checks passed
@aris-aiven aris-aiven deleted the tilman-transfered-object-keys-progress branch August 27, 2024 09:45
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.

5 participants