[Checkins] SVN: gocept.zeoraid/trunk/stresstest.py added a stress test script

Thomas Lotze tl at gocept.com
Thu Jan 8 09:59:48 EST 2009


Log message for revision 94624:
  added a stress test script

Changed:
  A   gocept.zeoraid/trunk/stresstest.py

-=-
Added: gocept.zeoraid/trunk/stresstest.py
===================================================================
--- gocept.zeoraid/trunk/stresstest.py	                        (rev 0)
+++ gocept.zeoraid/trunk/stresstest.py	2009-01-08 14:59:47 UTC (rev 94624)
@@ -0,0 +1,30 @@
+import time
+import transaction
+from ZEO.ClientStorage import ClientStorage
+from ZODB import DB
+import ZODB.POSException
+import ZEO.zrpc.error
+import ZEO.Exceptions
+import ZODB.utils
+
+
+storage = ClientStorage([('127.0.0.1', 8100)],#, ('127.0.0.1', 8201)],
+                        storage='1')
+db = DB(storage)
+conn = db.open()
+root = conn.root()
+
+root['x'] = 0
+
+while True:
+    root['x'] += 1
+    try:
+        transaction.commit()
+    except (ZODB.POSException.ConflictError,
+            ZEO.zrpc.error.DisconnectedError,
+            ZEO.Exceptions.ClientDisconnected):
+        transaction.abort()
+        continue
+    print root['x']
+    print ZODB.utils.oid_repr(storage.lastTransaction())
+    time.sleep(1)


Property changes on: gocept.zeoraid/trunk/stresstest.py
___________________________________________________________________
Added: svn:keywords
   + Id Rev Date
Added: svn:eol-style
   + native



More information about the Checkins mailing list