Created
December 29, 2016 12:50
-
-
Save sallyruthstruik/ef186ae48a6f79ec465b5d2699523990 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import webdav.client as wc | |
import time | |
options = { | |
'webdav_hostname': "https://webdav.yandex.ru", | |
'webdav_login': "s.kaledin@coin32.com", | |
'webdav_password': "*******" | |
} | |
client = wc.Client(options) | |
with open("file.txt", "w") as fd: | |
fd.write("1"*1024*1024) #1 mb | |
times = [] | |
for i in range(1000): | |
start = time.time() | |
client.upload( | |
local_path="file.txt", | |
remote_path="file.txt" | |
) | |
d = time.time() - start | |
times.append(d) | |
print "Block", i, "in", d, "seconds" | |
print "Average speed per all blocks", (i+1)/sum(times), "Mb/s", "per block", 1/d, "Mb/s" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment