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
a6b6ca2d
Commit
a6b6ca2d
authored
Nov 13, 2002
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #670: applied patch from Dieter Maurer to enhance
the Zope profiling support
parent
868ca805
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/App/ApplicationManager.py
lib/python/App/ApplicationManager.py
+7
-3
lib/python/App/dtml/profile.dtml
lib/python/App/dtml/profile.dtml
+16
-1
No files found.
doc/CHANGES.txt
View file @
a6b6ca2d
...
...
@@ -37,6 +37,9 @@ Zope Changes
Bugs Fixed
- Collector #670: applied patch from Dieter Maurer to enhance
the Zope profiling support
- Collector #651: WebDAV Lock Manager was broken.
- Collector #646: metal:slot was lost during the I18n merge.
...
...
lib/python/App/ApplicationManager.py
View file @
a6b6ca2d
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
__doc__
=
"""System management components"""
__version__
=
'$Revision: 1.8
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.8
4
$'
[
11
:
-
2
]
import
sys
,
os
,
time
,
Globals
,
Acquisition
,
os
,
Undo
...
...
@@ -176,15 +176,19 @@ class DebugManager(Fake, SimpleItem.Item, Acquisition.Implicit):
manage_profile
=
DTMLFile
(
'dtml/profile'
,
globals
())
def
manage_profile_stats
(
self
,
sort
=
'time'
,
limit
=
200
):
def
manage_profile_stats
(
self
,
sort
=
'time'
,
limit
=
200
,
stripDirs
=
1
,
mode
=
'stats'
):
"""Return profile data if available"""
stats
=
getattr
(
sys
,
'_ps_'
,
None
)
if
stats
is
None
:
return
None
output
=
StringIO
()
stdout
=
sys
.
stdout
if
stripDirs
:
from
copy
import
copy
;
stats
=
copy
(
stats
)
stats
.
strip_dirs
()
stats
.
sort_stats
(
sort
)
sys
.
stdout
=
output
stats
.
strip_dirs
().
sort_stats
(
sort
).
print_stats
(
limit
)
getattr
(
stats
,
'print_%s'
%
mode
)
(
limit
)
sys
.
stdout
.
flush
()
sys
.
stdout
=
stdout
return
output
.
getvalue
()
...
...
lib/python/App/dtml/profile.dtml
View file @
a6b6ca2d
...
...
@@ -3,7 +3,9 @@
<dtml-let sort="REQUEST.get('sort', 'time')"
limit="REQUEST.get('limit', 100)"
stats="manage_profile_stats(sort, limit)">
mode="REQUEST.get('mode', 'stats')"
stripDirs="REQUEST.get('stripDirs', 1)"
stats="manage_profile_stats(sort, limit, stripDirs, mode)">
<dtml-if stats>
<p class="form-help">
Profiling information is generated using the standard Python
...
...
@@ -35,6 +37,19 @@ Python profiler documentation</a>.
</dtml-in>
</select>
</td>
<td><strong>strip Dirs</strong>:
<input type=hidden name="stripDirs:int:default" value="0">
<input type=checkbox name="stripDirs:int" value="1" <dtml-if stripDirs>checked</dtml-if>>
</td>
<td><strong>Mode</strong>:
<select name="mode">
<dtml-in "('stats', 'callees', 'callers',)">
<option value="<dtml-var sequence-item>"<dtml-if
"mode==_['sequence-item']"> selected</dtml-if>><dtml-var
sequence-item>
</dtml-in>
</select>
</td>
<td>
<input type="submit" name="submit" value="Update">
</td>
...
...
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