projects
/
bluesky.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set up synthetic write benchmark.
[bluesky.git]
/
microbench
/
writebench.py
diff --git
a/microbench/writebench.py
b/microbench/writebench.py
index
4779955
..
d210033
100755
(executable)
--- 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 = []
start_time = time.time()
last_time = start_time
latencies = []
- while last_time < start_time +
3
0:
+ while last_time < start_time +
12
0:
now = time.time()
next_time = start_time + (1.0/rate) * count
time.sleep(max(0.0, next_time - now))
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
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__':
return latencies
if __name__ == '__main__':