cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r896699 - /incubator/cassandra/trunk/contrib/py_stress/stress.py
Date Wed, 06 Jan 2010 22:33:48 GMT
Author: jbellis
Date: Wed Jan  6 22:33:47 2010
New Revision: 896699

URL: http://svn.apache.org/viewvc?rev=896699&view=rev
Log:
add --progress-interval to stress.py.  patch by Brandon Williams; reviewed by jbellis for
CASSANDRA-676

Modified:
    incubator/cassandra/trunk/contrib/py_stress/stress.py

Modified: incubator/cassandra/trunk/contrib/py_stress/stress.py
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/contrib/py_stress/stress.py?rev=896699&r1=896698&r2=896699&view=diff
==============================================================================
--- incubator/cassandra/trunk/contrib/py_stress/stress.py (original)
+++ incubator/cassandra/trunk/contrib/py_stress/stress.py Wed Jan  6 22:33:47 2010
@@ -83,6 +83,8 @@
                   help="column family type")
 parser.add_option('-k', '--keep-going', action="store_true", dest="ignore",
                   help="ignore errors inserting or reading")
+parser.add_option('-i', '--progress-interval', type="int", default=10,
+                  dest="interval", help="progress report interval (seconds)")
 
 (options, args) = parser.parse_args()
  
@@ -226,13 +228,12 @@
         outf.write('total,interval_op_rate,elapsed_time\n')
         total = old_total = 0
         while True:
-            interval = 10
-            time.sleep(interval)
+            time.sleep(options.interval)
             old_total = total
             total = sum(self.counts[th.idx] for th in threads)
             delta = total - old_total
             elapsed_t = int(time.time()-start_t)
-            outf.write('%d,%d,%d\n' % (total, delta / interval,elapsed_t))
+            outf.write('%d,%d,%d\n' % (total, delta / options.interval,elapsed_t))
             if not [th for th in threads if th.isAlive()]:
                 break
 



Mime
View raw message