mirror of https://github.com/apache/cassandra
add --skip-keys option to stress.py. patch by jbellis; reviewed by brandonwilliams for CASSANDRA-1696
git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.6@1030270 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
39689a573e
commit
d656877345
|
|
@ -8,6 +8,7 @@ dev
|
|||
* Avoid dropping messages off the client request path (CASSANDRA-1676)
|
||||
* fix jna errno reporting (CASSANDRA-1694)
|
||||
* add friendlier error for UnknownHostException on startup (CASSANDRA-1697)
|
||||
* add --skip-keys option to stress.py (CASSANDRA-1696)
|
||||
|
||||
|
||||
0.6.6
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ except ImportError:
|
|||
parser = OptionParser()
|
||||
parser.add_option('-n', '--num-keys', type="int", dest="numkeys",
|
||||
help="Number of keys", default=1000**2)
|
||||
parser.add_option('-N', '--skip-keys', type="float", dest="skipkeys",
|
||||
help="Fraction of keys to skip initially", default=0)
|
||||
parser.add_option('-t', '--threads', type="int", dest="threads",
|
||||
help="Number of threads/procs to use", default=50)
|
||||
parser.add_option('-c', '--columns', type="int", dest="columns",
|
||||
|
|
@ -147,7 +149,8 @@ class Operation(Thread):
|
|||
def __init__(self, i, counts, latencies):
|
||||
Thread.__init__(self)
|
||||
# generator of the keys to be used
|
||||
self.range = xrange(keys_per_thread * i, keys_per_thread * (i + 1))
|
||||
self.range = xrange(int(keys_per_thread * (i + options.skipkeys)),
|
||||
keys_per_thread * (i + 1))
|
||||
# we can't use a local counter, since that won't be visible to the parent
|
||||
# under multiprocessing. instead, the parent passes a "counts" array
|
||||
# and an index that is our assigned counter.
|
||||
|
|
|
|||
Loading…
Reference in New Issue