You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by aj...@apache.org on 2004/02/24 00:02:57 UTC
cvs commit: jakarta-gump/python/gump/utils __init__.py
ajack 2004/02/23 15:02:57
Modified: python/gump/utils __init__.py
Log:
BOTH doesn't seem allowed.
Revision Changes Path
1.21 +11 -7 jakarta-gump/python/gump/utils/__init__.py
Index: __init__.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/utils/__init__.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- __init__.py 23 Feb 2004 21:55:35 -0000 1.20
+++ __init__.py 23 Feb 2004 23:02:57 -0000 1.21
@@ -63,6 +63,7 @@
"""
import logging
+import os
import sys
import types, StringIO
import time
@@ -365,7 +366,7 @@
def logResourceUtilization(message=None,):
try:
- import resource
+ from resource import getrusage
if not message:
message=''
@@ -376,10 +377,13 @@
resources=resource.getrusage(resource.RUSAGE_CHILDREN)
log.debug('Child Resources ' + message + ' ' + `resources`)
- resources=resource.getrusage(resource.RUSAGE_BOTH)
- log.debug('All Resources ' + message + ' ' + `resources`)
+ #resources=resource.getrusage(resource.RUSAGE_BOTH)
+ #log.debug('All Resources ' + message + ' ' + `resources`)
- except: pass
+ except Exception, details:
+ if not os.name == 'dos' and not os.name == 'nt':
+ log.error("Failed get resource utilization." \
+ + " : " + str(details), exc_info=1)
if __name__=='__main__':