[Zodb-checkins] CVS: ZODB3/ZEO - simul.py:1.12.8.2.18.14

Tim Peters cvs-admin at zope.org
Fri Dec 5 00:04:57 EST 2003


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

Modified Files:
      Tag: Zope-2_6-branch
	simul.py 
Log Message:
Thor:  added a TRIPS column, displaying the # of times the traveling
pointer reaches the list head.  Added a method that can (if you edit
the name) print more "interesting things" after each simulation period:

    # of non-empty worth sets
        typically over 100, sometimes over 200 -- it's finding
        relatively fine distinctions despite that the pointer only
        moves one slot per load (that's the only time _tick() is
        called)

    # of objects in cache
        disturbing:  with a 50MB cache, the # of objects plummets from
        14280 to 8955 across the 6+-hour zope.org slot; since we're
        seeing very few invalidations, the only way this can happen is
        if very large objects are kicking out many small objects to
        make room.  This is still simulating a perfect disk manager,
        making use of every byte in the file, so this can only get
        worse in real life.  In the slot after the 6+-hour slot, the
        # of cached objects zooms back up to 16979, so Thor must have
        kicked out the very large objects soon.  'Twould probably
        be better if it had never cached them!  Huge objects suck.

    aggregate size of objects in cache
        a sanity check; it's always just a little smaller than the
        cache size specified, which is expected and good


=== ZODB3/ZEO/simul.py 1.12.8.2.18.13 => 1.12.8.2.18.14 ===
--- ZODB3/ZEO/simul.py:1.12.8.2.18.13	Thu Dec  4 22:51:16 2003
+++ ZODB3/ZEO/simul.py	Fri Dec  5 00:04:55 2003
@@ -1503,7 +1503,7 @@
 
 class ThorSimulation(Simulation):
 
-    extraname = "evicts"
+    extras = "evicts", "trips"
 
     def __init__(self, cachelimit):
         Simulation.__init__(self, cachelimit)
@@ -1540,7 +1540,7 @@
         # Map an object.oid to its ThorNode.
         self.oid2object = {}
 
-        self.total_evicts = 0
+        self.total_evicts = self.total_trips = 0
 
     # Unlink object from the circular list, taking care not to lose
     # track of the current object.  Always call this instead of
@@ -1580,6 +1580,8 @@
             c = c.next
             if c is self.listhead:  # list is empty
                 return
+            self.total_trips += 1
+            self.trips += 1
         self._change_worth(c, (c.worth + 1) >> 1)
         self.currentobj = c.next
 
@@ -1622,7 +1624,7 @@
         # Reset base class
         Simulation.restart(self)
         # Reset additional per-run statistics
-        self.evicts = 0
+        self.evicts = self.trips = 0
 
     def write(self, oid, size):
         obj = self.oid2object.get(oid)
@@ -1645,6 +1647,13 @@
             self.invals += 1
             self.total_invals += 1
             self._evict_without_bumping_evict_stats(obj)
+
+    # Take the "x" off to see additional stats after each restart period.
+    def xreport(self):
+        Simulation.report(self)
+        print 'non-empty worth sets', sum(map(bool, self.worthsets)),
+        print 'objects', len(self.oid2object),
+        print 'size', self.currentsize
 
 #############################################################################
 # Perfection:  What if the cache were unbounded, and never forgot anything?




More information about the Zodb-checkins mailing list