[Zodb-checkins] SVN: ZODB/trunk/ Decoy dematerialization: removed the cacheStatistics, cacheMeanAge,

Tim Peters tim.one at comcast.net
Wed Jun 2 15:31:48 EDT 2004


Log message for revision 25199:
Decoy dematerialization:  removed the cacheStatistics, cacheMeanAge,
cacheMeanDeal, and cacheMeanDeac methods from the DB class.  They
were untested, undocumented, unused, and did nothing of use (the
first always returned an empty tuple, the rest always returned None).


-=-
Modified: ZODB/trunk/NEWS.txt
===================================================================
--- ZODB/trunk/NEWS.txt	2004-06-02 19:30:12 UTC (rev 25198)
+++ ZODB/trunk/NEWS.txt	2004-06-02 19:31:48 UTC (rev 25199)
@@ -11,6 +11,11 @@
 ZODB
 ----
 
+Methods removed from the database (ZODB.DB.DB) class:  cacheStatistics(),
+cacheMeanAge(), cacheMeanDeac(), and cacheMeanDeal().  These were
+undocumented, untested, and unused.  The first always returned an empty
+tuple, and the rest always returned None.
+
 When trying to do recovery to a time earlier than that of the most recent
 full backup, repozo.py failed to find the appropriate files, erroneously
 claiming "No files in repository before <specified time>".  This has

Modified: ZODB/trunk/src/ZODB/DB.py
===================================================================
--- ZODB/trunk/src/ZODB/DB.py	2004-06-02 19:30:12 UTC (rev 25198)
+++ ZODB/trunk/src/ZODB/DB.py	2004-06-02 19:31:48 UTC (rev 25199)
@@ -66,10 +66,9 @@
       - `Version Methods`: modifiedInVersion, abortVersion, commitVersion,
         versionEmpty
       - `Cache Inspection Methods`: cacheDetail, cacheExtremeDetail,
-        cacheFullSweep, cacheLastGCTime, cacheMinimize, cacheMeanAge,
-        cacheMeanDeac, cacheMeanDeal, cacheSize, cacheDetailSize,
-        getCacheSize, getVersionCacheSize, setCacheSize, setVersionCacheSize,
-        cacheStatistics
+        cacheFullSweep, cacheLastGCTime, cacheMinimize, cacheSize,
+        cacheDetailSize, getCacheSize, getVersionCacheSize, setCacheSize,
+        setVersionCacheSize
       - `Deprecated Methods`: getCacheDeactivateAfter,
         setCacheDeactivateAfter,
         getVersionCacheDeactivateAfter, setVersionCacheDeactivateAfter
@@ -151,22 +150,6 @@
         if hasattr(storage, 'undoInfo'):
             self.undoInfo = storage.undoInfo
 
-
-    def _cacheMean(self, attr):
-        # XXX this method doesn't work
-        m = [0, 0]
-        def f(con, m=m, attr=attr):
-            t = getattr(con._cache, attr)
-            m[0] += t
-            m[1] += 1
-
-        self._connectionMap(f)
-        if m[1]:
-            m = m[0] / m[1] # XXX should this be // ?
-        else:
-            m = None
-        return m
-
     def _closeConnection(self, connection):
         """Return a connection to the pool.
 
@@ -304,13 +287,6 @@
     def cacheMinimize(self):
         self._connectionMap(lambda c: c._cache.minimize())
 
-    def cacheMeanAge(self):
-        return self._cacheMean('cache_mean_age')
-    def cacheMeanDeac(self):
-        return self._cacheMean('cache_mean_deac')
-    def cacheMeanDeal(self):
-        return self._cacheMean('cache_mean_deal')
-
     def cacheSize(self):
         m=[0]
         def f(con, m=m):
@@ -674,9 +650,6 @@
     def setVersionPoolSize(self, v):
         self._version_pool_size=v
 
-    def cacheStatistics(self):
-        return () # :(
-
     def undo(self, id, txn=None):
         """Undo a transaction identified by id.
 




More information about the Zodb-checkins mailing list