This commit is contained in:
alex
2023-09-05 16:47:21 +02:00
parent 10f9209c51
commit 8c87f4049a
5 changed files with 220 additions and 0 deletions

27
run.py Normal file
View File

@@ -0,0 +1,27 @@
"Test connectivity on a small subset of files."
# copyright: Canonical
import datetime
import subprocess
from pathlib import Path
from loguru import logger as log
SERV_URL = "172.172.0.196::share_rsync"
TARGET = "/mnt/inststo/test"
if __name__ == "__main__":
for x in range(10):
start = datetime.datetime.now()
subprocess.run(
[
"rsync",
"-a",
f"{SERV_URL}/inststo/test",
f"/mnt/inststo",
],
capture_output=True,
# shell=True,
)
time = datetime.datetime.now() - start
size = sum(f.stat().st_size for f in Path(TARGET).glob("**/*") if f.is_file())
log.info(f"{size/time.total_seconds()/1000/1000/8} MB/s")
subprocess.run(["rm", "-rf", TARGET])