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
6de4ee54
Commit
6de4ee54
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend the query report with information about the resultset length
parent
3578c5d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
src/Products/ZCatalog/Catalog.py
src/Products/ZCatalog/Catalog.py
+4
-1
src/Products/ZCatalog/dtml/catalogReport.dtml
src/Products/ZCatalog/dtml/catalogReport.dtml
+6
-5
src/Products/ZCatalog/report.py
src/Products/ZCatalog/report.py
+6
-4
No files found.
src/Products/ZCatalog/Catalog.py
View file @
6de4ee54
...
...
@@ -520,7 +520,6 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
r
=
_apply_index
(
query
,
rs
)
else
:
r
=
_apply_index
(
query
)
cr
.
split
(
i
)
if
r
is
not
None
:
r
,
u
=
r
...
...
@@ -529,10 +528,14 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
# once we don't need to support the "return everything" case
# anymore
if
r
is
not
None
and
not
r
:
cr
.
split
(
i
,
0
)
return
LazyCat
([])
cr
.
split
(
i
,
len
(
r
))
w
,
rs
=
weightedIntersection
(
rs
,
r
)
if
not
rs
:
break
else
:
cr
.
split
(
i
,
0
)
cr
.
stop
()
...
...
src/Products/ZCatalog/dtml/catalogReport.dtml
View file @
6de4ee54
...
...
@@ -25,7 +25,7 @@
</td>
<td align="left" valign="top">
<div class="list-nav">
Recent
duration [ms]
Recent
</div>
</td>
</tr>
...
...
@@ -53,11 +53,12 @@
</td>
<td align="left" valign="top">
<div class="list-item">
<dtml-var expr="'%3.2f' % last['duration']">
[<dtml-in expr="last['details']" sort mapping>
&dtml-id;: <dtml-var expr="'%3.2f' % duration">
<dtml-var expr="'%3.2f' % last['duration']">ms
[<dtml-in expr="last['details']" sort mapping>
&dtml-id;:
<dtml-var expr="'%3.2f' % duration">ms /
&dtml-length; objects,
</dtml-in>]
</div>
</td>
</tr>
...
...
src/Products/ZCatalog/report.py
View file @
6de4ee54
...
...
@@ -48,7 +48,7 @@ def determine_value_indexes(indexes):
for
name
,
index
in
indexes
.
items
():
if
IUniqueValueIndex
.
providedBy
(
index
):
values
=
index
.
uniqueValues
()
if
values
and
len
(
values
)
<
MAX_DISTINCT_VALUES
:
if
values
and
len
(
list
(
values
)
)
<
MAX_DISTINCT_VALUES
:
# Only consider indexes which actually return a number
# greater than zero
new_value_indexes
.
add
(
name
)
...
...
@@ -117,7 +117,7 @@ class StopWatch(object):
self
.
init
()
self
.
start_time
=
time
.
time
()
def
split
(
self
,
label
):
def
split
(
self
,
label
,
result_length
=
None
):
current
=
time
.
time
()
start_time
,
stop_time
=
self
.
interim
.
get
(
label
,
(
None
,
None
))
...
...
@@ -126,7 +126,7 @@ class StopWatch(object):
return
self
.
interim
[
label
]
=
(
start_time
,
current
)
self
.
res
.
append
((
label
,
current
-
start_time
))
self
.
res
.
append
((
label
,
current
-
start_time
,
result_length
))
def
stop
(
self
):
self
.
end_time
=
time
.
time
()
...
...
@@ -210,6 +210,7 @@ class CatalogReport(StopWatch):
<duration of single indexes> := [{'id': <index_name1>,
'duration': <duration>,
'length': <resultset length>,
},
...
]
...
...
@@ -224,7 +225,8 @@ class CatalogReport(StopWatch):
'duration'
:
v
[
1
]
*
1000
,
'last'
:
{
'duration'
:
v
[
2
][
0
]
*
1000
,
'details'
:
[
dict
(
id
=
i
[
0
],
duration
=
i
[
1
]
*
1000
)
duration
=
i
[
1
]
*
1000
,
length
=
i
[
2
])
for
i
in
v
[
2
][
1
]],
},
}
...
...
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