You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2010/01/10 04:21:51 UTC

svn commit: r897589 - /incubator/cassandra/trunk/contrib/py_stress/stress.py

Author: jbellis
Date: Sun Jan 10 03:21:50 2010
New Revision: 897589

URL: http://svn.apache.org/viewvc?rev=897589&view=rev
Log:
fix potential divide-by-zero in stress.py.  patch by jbellis

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=897589&r1=897588&r2=897589&view=diff
==============================================================================
--- incubator/cassandra/trunk/contrib/py_stress/stress.py (original)
+++ incubator/cassandra/trunk/contrib/py_stress/stress.py Sun Jan 10 03:21:50 2010
@@ -254,8 +254,9 @@
             latency = sum(self.latencies[th.idx] for th in threads)
             delta = total - old_total
             delta_latency = latency - old_latency
+            delta_formatted = delta if delta > 0 else 'NAN'
             elapsed_t = int(time.time() - start_t)
-            outf.write('%d,%d,%f,%d\n' 
+            outf.write('%d,%d,%s,%d\n' 
                        % (total, delta / options.interval, delta_latency / delta, elapsed_t))
             if not [th for th in threads if th.isAlive()]:
                 break