Skip to content

Conversation

@jtratner
Copy link
Contributor

Replace the existing progress logger with tqdm, a library that makes
elegant progress bars that calculate rate of transfer, time remaining,
and also look nice on the CLI (i.e., stays on one line and doesn't gum
up the entire works). A future enhancement would be to make the progress
logger configurable, but I figure for now just showing a better one is a
bonus.

How this was tested:

  1. Tested stor cp -r and rm -r with various combinatiosn
  2. Ensure passes all unit tests.

I'm calling this a feature break: it does not break any existing APIs and the progress logger was never a public method exposed to users.

cc @kyleabeauchamp @wesleykendall @pkaleta @krhaas - if any of you have time to review that'd be awesome

Replace the existing progress logger with tqdm, a library that makes
elegant progress bars that calculate rate of transfer, time remaining,
and also look nice on the CLI (i.e., stays on one line and doesn't gum
up the entire works). A future enhancement would be to make the progress
logger configurable, but I figure for now just showing a better one is a
bonus.

How this was tested:

1. Tested stor cp -r and rm -r with various combinatiosn
2. Ensure passes all unit tests.

Sem-Ver: feature
"""
import argparse
import copy
from collections import OrderedDict
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK this import is unused

logger = progress_logger

def add_result(self, result):
self.update_progress(num_objects=1, addl_bytes=os.path.getszie(result['dest']))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a typo? getszie

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm... maybe I didn't let the s3 version bubble up long enough..

@jtratner
Copy link
Contributor Author

This functionality is semi-covered by the integration tests (which call copytree and friends). I think I can test it by checking for the calls to update_progress and/or grabbing the progress logger after running.

@kyleabeauchamp
Copy link
Contributor

A few typos to fix. Overall idea SGTM.

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