[CalendarServer-changes] [15682] CalendarServer/trunk/calendarserver/tools/dashtime.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Jun 17 11:52:17 PDT 2016


Revision: 15682
          http://trac.calendarserver.org//changeset/15682
Author:   cdaboo at apple.com
Date:     2016-06-17 11:52:17 -0700 (Fri, 17 Jun 2016)
Log Message:
-----------
Add some more data types.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/dashtime.py

Modified: CalendarServer/trunk/calendarserver/tools/dashtime.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/dashtime.py	2016-06-17 18:28:09 UTC (rev 15681)
+++ CalendarServer/trunk/calendarserver/tools/dashtime.py	2016-06-17 18:52:17 UTC (rev 15682)
@@ -137,6 +137,29 @@
 
 
 
+class MemoryDataType(DataType):
+    """
+    CPU use.
+    """
+
+    key = "mem"
+
+    @staticmethod
+    def title(item):
+        return "Memory Use %"
+
+
+    @staticmethod
+    def maxY(numHosts):
+        return 100 * numHosts
+
+
+    @staticmethod
+    def calculate(stats, item, hosts):
+        return sum([stats[onehost]["stats_system"]["memory percent"] for onehost in hosts])
+
+
+
 class RequestsDataType(DataType):
     """
     Number of requests.
@@ -187,6 +210,78 @@
 
 
 
+class Code500DataType(DataType):
+    """
+    Number of 500 requests.
+    """
+
+    key = "500"
+    skip60 = True
+
+    @staticmethod
+    def title(item):
+        return "Code 500/sec"
+
+
+    @staticmethod
+    def maxY(numHosts):
+        return None
+
+
+    @staticmethod
+    def calculate(stats, item, hosts):
+        return sum([stats[onehost]["stats"]["1m"]["500"] for onehost in hosts]) / 60.0
+
+
+
+class Code401DataType(DataType):
+    """
+    Number of 401 requests.
+    """
+
+    key = "401"
+    skip60 = True
+
+    @staticmethod
+    def title(item):
+        return "Code 401/sec"
+
+
+    @staticmethod
+    def maxY(numHosts):
+        return None
+
+
+    @staticmethod
+    def calculate(stats, item, hosts):
+        return sum([stats[onehost]["stats"]["1m"]["401"] for onehost in hosts]) / 60.0
+
+
+
+class MaxSlotsDataType(DataType):
+    """
+    Max slots.
+    """
+
+    key = "slots"
+    skip60 = True
+
+    @staticmethod
+    def title(item):
+        return "Max. Slots"
+
+
+    @staticmethod
+    def maxY(numHosts):
+        return None
+
+
+    @staticmethod
+    def calculate(stats, item, hosts):
+        return sum([stats[onehost]["stats"]["1m"]["max-slots"] for onehost in hosts])
+
+
+
 class JobsCompletedDataType(DataType):
     """
     Job completion count from job assignments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160617/a9d66847/attachment.html>


More information about the calendarserver-changes mailing list