Measure multipart uploads

see #304
This commit is contained in:
Matt Jibson 2015-08-31 13:48:52 -04:00
parent 92fb753dee
commit ab25542bd7

View file

@ -9,6 +9,7 @@ import boto.gs.key
from io import BufferedIOBase
import app
from storage.basestorage import BaseStorage
@ -152,6 +153,7 @@ class _CloudStorage(BaseStorage):
mp = self._cloud_bucket.initiate_multipart_upload(path, metadata=metadata,
**self._upload_params)
app.metric_queue.put('MultipartUploadStart', 1)
num_part = 1
while True:
try:
@ -163,8 +165,10 @@ class _CloudStorage(BaseStorage):
num_part += 1
io.close()
except IOError:
app.metric_queue.put('MultipartUploadFailure', 1)
mp.cancel_upload()
break
app.metric_queue.put('MultipartUploadSuccess', 1)
mp.complete_upload()
def list_directory(self, path=None):