File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
"""The BMA CLI wrapper."""
2
+ import time
2
3
3
4
import json
4
5
import logging
@@ -109,10 +110,14 @@ def upload(files: list[str]) -> None:
109
110
pf = Path (f )
110
111
if pf .is_dir ():
111
112
continue
113
+ size = pf .stat ().st_size
112
114
click .echo (f"Uploading file { f } ..." )
115
+ start = time .time ()
113
116
result = client .upload_file (path = pf , file_license = config ["license" ], attribution = config ["attribution" ])
114
117
metadata = result ["bma_response" ]
115
- click .echo (f"File { metadata ['uuid' ]} uploaded OK!" )
118
+ t = round (time .time () - start , 2 )
119
+ click .echo (f"File { metadata ['uuid' ]} uploaded OK! It took { t } seconds to upload { size } bytes, speed { round (size / t )} bytes/sec" )
120
+ logger .debug (f"Done, " )
116
121
file_uuids .append (metadata ["uuid" ])
117
122
click .echo (f"Finished uploading { len (file_uuids )} files, creating album..." )
118
123
now = datetime .isoformat (datetime .now (tz = UTC ))
You can’t perform that action at this time.
0 commit comments