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
41935174
Commit
41935174
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better benchmark initialization
parent
08ea1b10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/Products/ZCatalog/plan.py
src/Products/ZCatalog/plan.py
+5
-5
No files found.
src/Products/ZCatalog/plan.py
View file @
41935174
...
...
@@ -111,12 +111,12 @@ class CatalogPlan(object):
"""
def
__init__
(
self
,
catalog
,
query
=
None
,
threshold
=
0.1
):
self
.
init_timer
()
self
.
catalog
=
catalog
self
.
query
=
query
self
.
key
=
make_key
(
catalog
,
query
)
self
.
threshold
=
threshold
self
.
cid
=
self
.
get_id
()
self
.
init_timer
()
def
get_id
(
self
):
parent
=
aq_parent
(
self
.
catalog
)
...
...
@@ -143,7 +143,10 @@ class CatalogPlan(object):
def
benchmark
(
self
):
# holds the benchmark of each index
return
self
.
prioritymap
().
get
(
self
.
key
,
None
)
bm
=
self
.
prioritymap
().
get
(
self
.
key
,
None
)
if
bm
is
None
:
self
.
prioritymap
()[
self
.
key
]
=
{}
return
bm
def
plan
(
self
):
benchmark
=
self
.
benchmark
()
...
...
@@ -158,9 +161,6 @@ class CatalogPlan(object):
def
start
(
self
):
self
.
init_timer
()
self
.
start_time
=
time
.
time
()
benchmark
=
self
.
benchmark
()
if
benchmark
is
None
:
self
.
prioritymap
()[
self
.
key
]
=
{}
def
start_split
(
self
,
label
,
result
=
None
):
self
.
interim
[
label
]
=
(
time
.
time
(),
None
)
...
...
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