[Zope-Checkins] SVN: Zope/branches/andig-catalog-report/src/Products/ZCatalog/Catalog Assorted fixes
Hanno Schlichting
hannosch at hannosch.eu
Sat Jul 24 14:14:45 EDT 2010
Log message for revision 115043:
Assorted fixes
Changed:
U Zope/branches/andig-catalog-report/src/Products/ZCatalog/Catalog.py
U Zope/branches/andig-catalog-report/src/Products/ZCatalog/CatalogReport.py
-=-
Modified: Zope/branches/andig-catalog-report/src/Products/ZCatalog/Catalog.py
===================================================================
--- Zope/branches/andig-catalog-report/src/Products/ZCatalog/Catalog.py 2010-07-24 18:08:27 UTC (rev 115042)
+++ Zope/branches/andig-catalog-report/src/Products/ZCatalog/Catalog.py 2010-07-24 18:14:44 UTC (rev 115043)
@@ -28,9 +28,8 @@
from BTrees.IOBTree import IOBTree
from Lazy import LazyMap, LazyCat, LazyValues
from CatalogBrains import AbstractCatalogBrain, NoBrainer
+from .CatalogReport import CatalogReport
-from CatalogReport import CatalogReport
-
LOG = logging.getLogger('Zope.ZCatalog')
@@ -86,7 +85,7 @@
self._v_brains = brains
self.updateBrains()
-
+
def __len__(self):
return self._length()
@@ -468,7 +467,6 @@
# Note that if the indexes find query arguments, but the end result
# is an empty sequence, we do nothing
-
cr = self.getCatalogReport(request)
cr.start()
@@ -479,9 +477,7 @@
continue
cr.split(i)
-
r = _apply_index(request)
-
cr.split(i)
if r is not None:
@@ -491,8 +487,7 @@
break
cr.stop()
-
-
+
if rs is None:
# None of the indexes found anything to do with the request
# We take this to mean that the query was empty (an empty filter)
@@ -750,18 +745,14 @@
__call__ = searchResults
-
- def getCatalogReport(self,request=None):
+ def getCatalogReport(self, request=None):
+ """Reports about the duration of queries.
"""
- Reports about the duration of queries
- """
+ parent = Acquisition.aq_base(Acquisition.aq_parent(self))
+ threshold = getattr(parent, 'long_query_time', 0.1)
+ return CatalogReport(self, request, threshold)
- threshold = getattr(self.aq_parent,'long_query_time',0.1)
- cr = CatalogReport(self,request,threshold)
- return cr
-
-
class CatalogSearchArgumentsMap:
"""Multimap catalog arguments coming simultaneously from keywords
and request.
Modified: Zope/branches/andig-catalog-report/src/Products/ZCatalog/CatalogReport.py
===================================================================
--- Zope/branches/andig-catalog-report/src/Products/ZCatalog/CatalogReport.py 2010-07-24 18:08:27 UTC (rev 115042)
+++ Zope/branches/andig-catalog-report/src/Products/ZCatalog/CatalogReport.py 2010-07-24 18:14:44 UTC (rev 115043)
@@ -167,7 +167,7 @@
"""Catalog report class to meassure and identify catalog queries.
"""
- def __init__(self, catalog, request=None, threshold=0):
+ def __init__(self, catalog, request=None, threshold=0.1):
super(CatalogReport, self).__init__()
self.catalog = catalog
More information about the Zope-Checkins
mailing list