X-Git-Url: http://git.vrable.net/?p=bluesky.git;a=blobdiff_plain;f=microbench%2Fwritebench.py;h=d21003384ecc89ee4fdb5d844c93499c0fa88ff8;hp=4779955eaf6d73f7bbf8c4bb553769fd78906fe3;hb=611c10480ccfce1545998554503392a69f9d72b3;hpb=f72f711008d701adfbce0ae175b672bd5b81aea2 diff --git a/microbench/writebench.py b/microbench/writebench.py index 4779955..d210033 100755 --- a/microbench/writebench.py +++ b/microbench/writebench.py @@ -26,7 +26,7 @@ def run_writebench(path, rate): start_time = time.time() last_time = start_time latencies = [] - while last_time < start_time + 30: + while last_time < start_time + 120: now = time.time() next_time = start_time + (1.0/rate) * count time.sleep(max(0.0, next_time - now)) @@ -34,6 +34,9 @@ def run_writebench(path, rate): latencies.append(write_file(path, count)) print latencies[-1] count += 1 + end_time = time.time() + duration = end_time - start_time + print "# %s MB/s (%d MB/%s seconds)" % (count / duration, count, duration) return latencies if __name__ == '__main__':