[Erp5-report] r14176 - in /erp5/trunk/utils/oood: showthreads.py start.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Apr 24 02:15:56 CEST 2007
Author: bartek
Date: Tue Apr 24 02:15:54 2007
New Revision: 14176
URL: http://svn.erp5.org?rev=14176&view=rev
Log:
show threading status by using start.py cmdline switch
Removed:
erp5/trunk/utils/oood/showthreads.py
Modified:
erp5/trunk/utils/oood/start.py
Modified: erp5/trunk/utils/oood/start.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/start.py?rev=14176&r1=14175&r2=14176&view=diff
==============================================================================
--- erp5/trunk/utils/oood/start.py (original)
+++ erp5/trunk/utils/oood/start.py Tue Apr 24 02:15:54 2007
@@ -217,11 +217,23 @@
Log.info("Pool - Virtual frame buffer killed")
+def showThreadingStatus():
+ import xmlrpclib
+ uri = 'http://%s:%d' % (config.server_host, config.server_port)
+ sp = xmlrpclib.ServerProxy(uri)
+ try:
+ print sp.threadingStatus()
+ except Exception, e:
+ print 'we got exception:'
+ print e
+ print 'probably server is not running'
+
+
def showPoolStatus():
"""
Show Pool details and statistics.
"""
- # TODO: must be done (!)
+ #TODO: must be done (!)
print "===== Pool Statistics ====="
print "Status: %s" % "TODO"
print "Size: %s" % config.pool_size
@@ -241,6 +253,8 @@
Flush the pool: kill all OOo instances to empty the pool.
-s, --status, --stat
Show pool statistics and status.
+ -r, --threads, --th
+ Show currently running threads
-h, --help
Show this screen.
""" % sys.argv[0]
@@ -251,8 +265,8 @@
# Parse options and parameters
try:
opts, args = getopt.getopt( sys.argv[1:]
- , "hifsdt"
- , ["help", "init", "flush", "status", "stat", "top"]
+ , "hifsdtr"
+ , ["help", "init", "flush", "status", "stat", "threads", "top"]
)
# Check args number
if len(opts) == 0:
@@ -284,6 +298,9 @@
elif o in ("-s", "--status", "--stat"):
showPoolStatus()
sys.exit(0)
+ elif o in ("-r", "--threads", "--th"):
+ showThreadingStatus()
+ sys.exit(0)
# Exit on general error
sys.exit(1)
More information about the Erp5-report
mailing list