[CalendarServer-changes] [1869] CalDAVTester/trunk/monitor.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 11 10:58:09 PDT 2007


Revision: 1869
          http://trac.macosforge.org/projects/calendarserver/changeset/1869
Author:   cdaboo at apple.com
Date:     2007-09-11 10:58:08 -0700 (Tue, 11 Sep 2007)

Log Message:
-----------
Add some more info to status output.

Modified Paths:
--------------
    CalDAVTester/trunk/monitor.py

Modified: CalDAVTester/trunk/monitor.py
===================================================================
--- CalDAVTester/trunk/monitor.py	2007-09-11 17:42:47 UTC (rev 1868)
+++ CalDAVTester/trunk/monitor.py	2007-09-11 17:58:08 UTC (rev 1869)
@@ -188,9 +188,12 @@
         # Now calculate actual monitor run time
         elapsed_time = 0
         start = None
+        firststart = None
         for item in startstops:
             if start is None and item.find("Starting Monitor") != -1:
                 start = self.parse_date(item)
+                if firststart is None:
+                    firststart = self.parse_date(item)
             elif start is not None and item.find("Stopped Monitor"):
                 end = self.parse_date(item)
                 delta = end - start
@@ -220,6 +223,7 @@
             print """
 <h3>Server: %s</h3>
 <table>
+<tr><td>Since</td><td>%s</td></tr>
 <tr><td>Uptime</td><td>approx. %d (hours) / %d (days)</td></tr>
 <tr><td>Downtime</td><td>approx. %d (minutes) / %d (hours)</td></tr>
 <tr><td>Percentage</td><td>%.3f%%</td></tr>
@@ -227,17 +231,18 @@
 <tr><td>Current Status</td><td>%s<td></tr>
 </table>
 
-""" % (self.minfo.name, uptime/60/60, uptime/60/60/24, downtime/60, downtime/60/60, ((uptime - downtime) * 100.0)/uptime, status)
+""" % (self.minfo.name, str(firststart), uptime/60/60, uptime/60/60/24, downtime/60, downtime/60/60, ((uptime - downtime) * 100.0)/uptime, status)
         else:
             print """
 Server: %s
+    Since:      %s
     Uptime:     approx. %d (hours) / %d (days)
     Downtime:   approx. %d (minutes) / %d (hours)
     Percentage: %.3f%%
 
     Current Status: %s
 
-""" % (self.minfo.name, uptime/60/60, uptime/60/60/24, downtime/60, downtime/60/60, ((uptime - downtime) * 100.0)/uptime, status)
+""" % (self.minfo.name, str(firststart), uptime/60/60, uptime/60/60/24, downtime/60, downtime/60/60, ((uptime - downtime) * 100.0)/uptime, status)
 
     def parse_date(self, line):
         

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070911/cbfdeb02/attachment.html


More information about the calendarserver-changes mailing list