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
17e9f372
Commit
17e9f372
authored
Jun 09, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added manage_debug page and simple refcount report.
parent
978147e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
1 deletion
+56
-1
lib/python/App/ApplicationManager.py
lib/python/App/ApplicationManager.py
+29
-1
lib/python/App/debug.dtml
lib/python/App/debug.dtml
+27
-0
No files found.
lib/python/App/ApplicationManager.py
View file @
17e9f372
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__doc__
=
"""System management components"""
__version__
=
'$Revision: 1.4
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
9
$'
[
11
:
-
2
]
import
sys
,
os
,
time
,
string
,
Globals
,
Acquisition
,
os
...
...
@@ -96,6 +96,7 @@ from App.Dialogs import MessageDialog
from
Product
import
ProductFolder
from
version_txt
import
version_txt
class
Fake
:
def
locked_in_version
(
self
):
return
0
...
...
@@ -126,6 +127,10 @@ class VersionManager(Fake, SimpleItem.Item, Acquisition.Implicit):
{
'label'
:
'Version'
,
'action'
:
'manage_main'
},
)
class
ApplicationManager
(
Folder
,
CacheManager
):
"""System management"""
...
...
@@ -232,6 +237,29 @@ class ApplicationManager(Folder,CacheManager):
if
s
>=
1048576.0
:
return
'%.1fM'
%
(
s
/
1048576.0
)
return
'%.1fK'
%
(
s
/
1024.0
)
manage_debug
=
HTMLFile
(
'debug'
,
globals
())
def
get_refcounts
(
self
,
n
=
100
,
t
=
(
type
(
Fake
),
type
(
Acquisition
.
Implicit
))):
# get class refcount info
dict
=
{}
for
m
in
sys
.
modules
.
values
():
for
sym
in
dir
(
m
):
ob
=
getattr
(
m
,
sym
)
if
type
(
ob
)
in
t
:
dict
[
ob
]
=
sys
.
getrefcount
(
ob
)
pairs
=
map
(
lambda
x
:
(
x
[
1
],
'%s'
%
x
[
0
].
__name__
),
dict
.
items
())
pairs
.
sort
()
pairs
.
reverse
()
pairs
=
pairs
[:
n
]
return
pairs
if
hasattr
(
sys
,
'ZMANAGED'
):
manage_restartable
=
1
...
...
lib/python/App/debug.dtml
0 → 100644
View file @
17e9f372
<html>
<head>
<title>
Debug Information
</title>
</head>
<body
bgcolor=
"#FFFFFF"
link=
"#000099"
vlink=
"#555555"
>
<!--#var manage_tabs-->
<h3>
Debug Information
</h3>
<form>
<p>
<ul>
<li>
Zope version:
<!--#var version_txt-->
<li>
Python version:
<!--#var sys_version-->
<li>
System Platform:
<!--#var sys_platform-->
<li>
Process ID:
<!--#var process_id-->
<li>
Running for:
<!--#var process_time-->
<li>
Refcounts:
<select
name=
"foo"
>
<!--#in
get_refcounts-->
<option>
<!--#var
sequence-item-->
:
<!--#var sequence-key-->
</option>
<!--#/in
-->
</select>
</ul>
</p>
</form>
</body>
</html>
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