[CalendarServer-changes] [5709] CalendarServer/trunk/contrib/tools/request_monitor.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 9 06:52:19 PDT 2010


Revision: 5709
          http://trac.macosforge.org/projects/calendarserver/changeset/5709
Author:   cdaboo at apple.com
Date:     2010-06-09 06:52:17 -0700 (Wed, 09 Jun 2010)
Log Message:
-----------
Added --procs option to limit the number of processes reported.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/tools/request_monitor.py

Modified: CalendarServer/trunk/contrib/tools/request_monitor.py
===================================================================
--- CalendarServer/trunk/contrib/tools/request_monitor.py	2010-06-09 03:37:25 UTC (rev 5708)
+++ CalendarServer/trunk/contrib/tools/request_monitor.py	2010-06-09 13:52:17 UTC (rev 5709)
@@ -149,16 +149,20 @@
 
 def usage():
     print "-h         print help and exit"
-    print "--lines N  specifies how many lines to tail from access.log"
+    print "--lines N  specifies how many lines to tail from access.log (default: 10000)"
+    print "--procs N  specifies how many python processes are expected in the log file (default: 80)"
 
 numLines = 10000
-options, args = getopt.getopt(sys.argv[1:], "h", ["lines=",])
+numProcs = 80
+options, args = getopt.getopt(sys.argv[1:], "h", ["lines=", "procs=",])
 for option, value in options:
     if option == "-h":
         usage()
         sys.exit(0)
     elif option == "--lines":
         numLines = int(value)
+    elif option == "--procs":
+        numProcs = int(value)
 
 
 while True:
@@ -303,7 +307,7 @@
             print
 
         print "Proc:   Peak outstanding:        Seconds of processing (number of requests):"
-        for l in xrange(8):
+        for l in xrange(numProcs/10 + 1):
             base = l * 10
             print "%2d-%2d: " % (base, base+9),
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100609/f492b10c/attachment-0001.html>


More information about the calendarserver-changes mailing list