Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c1b9b0e5
Commit
c1b9b0e5
authored
Jul 24, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assorted fixes
parent
4451e49e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
src/Products/ZCatalog/Catalog.py
src/Products/ZCatalog/Catalog.py
+8
-17
src/Products/ZCatalog/CatalogReport.py
src/Products/ZCatalog/CatalogReport.py
+1
-1
No files found.
src/Products/ZCatalog/Catalog.py
View file @
c1b9b0e5
...
...
@@ -28,8 +28,7 @@ from BTrees.OIBTree import OIBTree
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 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
self
.
_v_brains
=
brains
self
.
updateBrains
()
def
__len__
(
self
):
return
self
.
_length
()
...
...
@@ -468,7 +467,6 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
# 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 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
continue
cr
.
split
(
i
)
r
=
_apply_index
(
request
)
cr
.
split
(
i
)
if
r
is
not
None
:
...
...
@@ -491,8 +487,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
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,16 +745,12 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
__call__
=
searchResults
def
getCatalogReport
(
self
,
request
=
None
):
def
getCatalogReport
(
self
,
request
=
None
):
"""Reports about the duration of queries.
"""
Reports about the duration of queries
"""
threshold
=
getattr
(
self
.
aq_parent
,
'long_query_time'
,
0.1
)
cr
=
CatalogReport
(
self
,
request
,
threshold
)
return
cr
parent
=
Acquisition
.
aq_base
(
Acquisition
.
aq_parent
(
self
))
threshold
=
getattr
(
parent
,
'long_query_time'
,
0.1
)
return
CatalogReport
(
self
,
request
,
threshold
)
class
CatalogSearchArgumentsMap
:
...
...
src/Products/ZCatalog/CatalogReport.py
View file @
c1b9b0e5
...
...
@@ -167,7 +167,7 @@ class CatalogReport(StopWatch):
"""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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment