tuneable column size for stress.py. Patch by Tyler Hobbs, reviewed by brandonwilliams for CASSANDRA-1579

git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.6@1005533 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brandon Williams 2010-10-07 17:23:21 +00:00
parent be00dc038e
commit bf5bbd653f
1 changed files with 3 additions and 0 deletions

View File

@ -65,6 +65,8 @@ 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",
help="Number of columns per key", default=5)
parser.add_option('-S', '--column-size', type="int", dest="column_size",
help="Size of column values in bytes", default=32)
parser.add_option('-d', '--nodes', type="string", dest="nodes",
help="Host nodes (comma separated)", default="localhost")
parser.add_option('-s', '--stdev', type="float", dest="stdev", default=0.1,
@ -163,6 +165,7 @@ class Operation(Thread):
class Inserter(Operation):
def run(self):
data = md5(str(get_ident())).hexdigest()
data = data * int(options.column_size/len(data)) + data[:options.column_size % len(data)]
columns = [Column('C' + str(j), data, 0) for j in xrange(columns_per_key)]
fmt = '%0' + str(len(str(total_keys))) + 'd'
if 'super' == options.cftype: