diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-29 14:06:50 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-29 14:08:43 +0200 |
| commit | 884f09cbde3882de8e7db3bd90d856f499a0e706 (patch) | |
| tree | 35e9f527cb9551e4af04e6099c3692501e124da1 /src/benchmarks/lld.py | |
| parent | cf1e78a3344852f1d13b45f6d8ff12836e13fff6 (diff) | |
| download | allocbench-884f09cbde3882de8e7db3bd90d856f499a0e706.tar.gz allocbench-884f09cbde3882de8e7db3bd90d856f499a0e706.zip | |
move urlretrieve report hook to util.py and use archive in dj_trace
Diffstat (limited to 'src/benchmarks/lld.py')
| -rw-r--r-- | src/benchmarks/lld.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/benchmarks/lld.py b/src/benchmarks/lld.py index c5c802b..bcedced 100644 --- a/src/benchmarks/lld.py +++ b/src/benchmarks/lld.py @@ -25,6 +25,7 @@ import sys import matplotlib.pyplot as plt from src.benchmark import Benchmark +from src.util import download_reporthook class BenchmarkLld(Benchmark): @@ -50,16 +51,6 @@ class BenchmarkLld(Benchmark): def prepare(self): super().prepare() - def reporthook(blocknum, blocksize, totalsize): - readsofar = blocknum * blocksize - if totalsize > 0: - percent = readsofar * 1e2 / totalsize - status = "\r%5.1f%% %*d / %d" % ( - percent, len(str(totalsize)), readsofar, totalsize) - sys.stderr.write(status) - else: # total size is unknown - sys.stderr.write(f"\rdownloaded {readsofar}") - test_dir = "lld-speed-test" test_archive = f"{test_dir}.tar.xz" if not os.path.isdir(test_dir): @@ -69,7 +60,7 @@ class BenchmarkLld(Benchmark): return False url = f"https://s3-us-west-2.amazonaws.com/linker-tests/{test_archive}" - urlretrieve(url, test_archive, reporthook) + urlretrieve(url, test_archive, download_reporthook) sys.stderr.write("\n") # Extract tests |
