Skip to content

Commit

Permalink
updated benchmark kvs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Stivers committed Jul 16, 2014
1 parent c1ad1c3 commit 9c76ff0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions benchmarks/kvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,22 @@ def operations(k, n, r, w):
rn = long(n * (float(r)/float(100)))
wn = long(n * (float(w)/float(100)))
while rn + wn > 0:
op = random.choice(CHOICE_OP)
if op == READ_OP and rn > 0:
if rn > 0 and wn > 0:
op = random.choice(CHOICE_OP)
if op == READ_OP:
rn -= 1
else:
wn -= 1
elif rn > 0:
op = READ_OP
rn -= 1
else:
op = WRITE_OP
wn -= 1

yield (op, random.randrange(1, k, 1))


################################################################################
# Application
################################################################################
Expand Down

0 comments on commit 9c76ff0

Please sign in to comment.