cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1005533 - in /cassandra: branches/cassandra-0.6/contrib/py_stress/stress.py trunk/contrib/py_stress/stress.py
Date Thu, 07 Oct 2010 17:23:22 GMT
Author: brandonwilliams
Date: Thu Oct  7 17:23:21 2010
New Revision: 1005533

URL: http://svn.apache.org/viewvc?rev=1005533&view=rev
Log:
tuneable column size for stress.py. Patch by Tyler Hobbs, reviewed by brandonwilliams for
CASSANDRA-1579

Modified:
    cassandra/branches/cassandra-0.6/contrib/py_stress/stress.py
    cassandra/trunk/contrib/py_stress/stress.py

Modified: cassandra/branches/cassandra-0.6/contrib/py_stress/stress.py
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/contrib/py_stress/stress.py?rev=1005533&r1=1005532&r2=1005533&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/contrib/py_stress/stress.py (original)
+++ cassandra/branches/cassandra-0.6/contrib/py_stress/stress.py Thu Oct  7 17:23:21 2010
@@ -65,6 +65,8 @@ parser.add_option('-t', '--threads', typ
                   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:

Modified: cassandra/trunk/contrib/py_stress/stress.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/py_stress/stress.py?rev=1005533&r1=1005532&r2=1005533&view=diff
==============================================================================
--- cassandra/trunk/contrib/py_stress/stress.py (original)
+++ cassandra/trunk/contrib/py_stress/stress.py Thu Oct  7 17:23:21 2010
@@ -65,6 +65,8 @@ parser.add_option('-t', '--threads', typ
                   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=34)
 parser.add_option('-C', '--cardinality', type="int", dest="cardinality",
                   help="Number of unique values stored in columns", default=50)
 parser.add_option('-d', '--nodes', type="string", dest="nodes",
@@ -131,7 +133,8 @@ if consistency is None:
 def generate_values():
     values = []
     for i in xrange(0, options.cardinality):
-        values.append('%d-%s' % (i, md5(str(i)).hexdigest()))
+        h = md5(str(i)).hexdigest()
+        values.append(h * int(options.column_size/len(h)) + h[:options.column_size % len(h)])
     return values
 
 def key_generator_gauss():



Mime
View raw message