[CalendarServer-changes] [13639] CalendarServer/trunk/calendarserver

source_changes at macosforge.org source_changes at macosforge.org
Mon Jun 16 13:09:15 PDT 2014


Revision: 13639
          http://trac.calendarserver.org//changeset/13639
Author:   cdaboo at apple.com
Date:     2014-06-16 13:09:15 -0700 (Mon, 16 Jun 2014)
Log Message:
-----------
dashboard tweaks.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/dashboard_service.py
    CalendarServer/trunk/calendarserver/tools/dashboard.py

Modified: CalendarServer/trunk/calendarserver/dashboard_service.py
===================================================================
--- CalendarServer/trunk/calendarserver/dashboard_service.py	2014-06-13 21:36:14 UTC (rev 13638)
+++ CalendarServer/trunk/calendarserver/dashboard_service.py	2014-06-16 20:09:15 UTC (rev 13639)
@@ -161,10 +161,9 @@
         @return: the JSON result.
         @rtype: L{str}
         """
-        directory = self.factory.store.directoryService()
-        if hasattr(directory, "stats"):
-            return succeed(directory.stats())
-        else:
+        try:
+            return succeed(self.factory.store.directoryService().stats())
+        except AttributeError:
             return succeed({})
 
 

Modified: CalendarServer/trunk/calendarserver/tools/dashboard.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/dashboard.py	2014-06-13 21:36:14 UTC (rev 13638)
+++ CalendarServer/trunk/calendarserver/tools/dashboard.py	2014-06-16 20:09:15 UTC (rev 13639)
@@ -921,6 +921,7 @@
         self.lastResult = records
 
 
+
 class DirectoryStatsWindow(BaseWindow):
     """
     Displays the status of the server's directory service calls
@@ -960,7 +961,7 @@
             "Method", "Calls", "Total", "Average"
         )
         s2 = " {:<40}{:>15}{:>15}{:>15} ".format(
-            "", "", "(sec)", "(sec)"
+            "", "", "(sec)", "(ms)"
         )
         if self.usesCurses:
             self.window.addstr(y, x, s1, curses.A_REVERSE)
@@ -977,11 +978,11 @@
             overallCount += count
             overallTimeSpent += timeSpent
 
-            s = " {:<40}{:>15d}{:>15.1f}{:>15.5f} ".format(
+            s = " {:<40}{:>15d}{:>15.1f}{:>15.3f} ".format(
                 methodName,
                 count,
                 timeSpent,
-                timeSpent / count,
+                (1000.0 * timeSpent) / count,
             )
             try:
                 if self.usesCurses:
@@ -992,12 +993,11 @@
                 pass
             y += 1
 
-
         s = " {:<40}{:>15d}{:>15.1f}{:>15.5f} ".format(
             "Total:",
             overallCount,
             overallTimeSpent,
-            safeDivision(overallTimeSpent, overallCount, 1.0)
+            safeDivision(overallTimeSpent, overallCount, 1000.0)
         )
         if self.usesCurses:
             self.window.hline(y, x, "-", self.FORMAT_WIDTH - 2)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140616/eecdffec/attachment.html>


More information about the calendarserver-changes mailing list