[Zodb-checkins] CVS: ZODB3/ZEO - stats.py:1.7

Guido van Rossum guido@python.org
Wed, 4 Sep 2002 13:59:52 -0400


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv10775

Modified Files:
	stats.py 
Log Message:
- Fix bug in previous checkin: unpack -> struct.unpack.

- Always print start and flip events.  Add the newline before the
  stats back.


=== ZODB3/ZEO/stats.py 1.6 => 1.7 ===
--- ZODB3/ZEO/stats.py:1.6	Wed Sep  4 13:57:34 2002
+++ ZODB3/ZEO/stats.py	Wed Sep  4 13:59:52 2002
@@ -115,7 +115,7 @@
             file0 += 1
         code = code & 0x7e
         bycode[code] = bycode.get(code, 0) + 1
-        if verbose:
+        if verbose or code in (0x00, 0x70):
             print "%s %d %02x %016x %016x %1s %s" % (
                 time.ctime(ts)[4:-5],
                 current,
@@ -135,8 +135,7 @@
 
     # Print statistics
     if dostats:
-        if verbose:
-            print
+        print
         print "Read %s records (%s bytes) in %.1f seconds" % (
             addcommas(records), addcommas(bytes), rte-rt0)
         print "Version:    %s records" % addcommas(versions)
@@ -160,7 +159,7 @@
                 explain.get(code) or "*** unknown code ***")
 
 def U64(s):
-    h, v = unpack(">II", s)
+    h, v = struct.unpack(">II", s)
     return (long(h) << 32) + v
 
 def addcommas(n):