cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1030270 - in /cassandra/branches/cassandra-0.6: CHANGES.txt contrib/py_stress/stress.py
Date Tue, 02 Nov 2010 22:52:19 GMT
Author: jbellis
Date: Tue Nov  2 22:52:19 2010
New Revision: 1030270

URL: http://svn.apache.org/viewvc?rev=1030270&view=rev
Log:
add --skip-keys option to stress.py.  patch by jbellis; reviewed by brandonwilliams for CASSANDRA-1696

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

Modified: cassandra/branches/cassandra-0.6/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/CHANGES.txt?rev=1030270&r1=1030269&r2=1030270&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.6/CHANGES.txt Tue Nov  2 22:52:19 2010
@@ -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

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=1030270&r1=1030269&r2=1030270&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/contrib/py_stress/stress.py (original)
+++ cassandra/branches/cassandra-0.6/contrib/py_stress/stress.py Tue Nov  2 22:52:19 2010
@@ -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.



Mime
View raw message