]> git.ipfire.org Git - people/ms/westferry.git/commitdiff
analytics: Add the context switches graph
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 12 Dec 2015 22:43:55 +0000 (23:43 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 12 Dec 2015 22:43:55 +0000 (23:43 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/westferry/handlers/analytics.py

index 488b8d7b134a2023317187810c1d525fa10a9e64..c098331d00f41b734b44964295bcd9e4a58d73e8 100644 (file)
@@ -193,6 +193,7 @@ class AnalyticsSystemBaseHandler(AnalyticsBaseHandler):
                # Others
                s = m.add_submenu(_("More"))
                s.add_handler(AnalyticsSystemEntropyHandler)
+               s.add_handler(AnalyticsSystemContextSwitchesHandler)
 
                return m
 
@@ -265,6 +266,20 @@ class AnalyticsSystemEntropyHandler(AnalyticsSystemBaseHandler):
                self.render_graphs(graphs)
 
 
+class AnalyticsSystemContextSwitchesHandler(AnalyticsSystemBaseHandler):
+       url = r"/analytics/system/context-switches"
+       title = N_("Context Switches")
+
+       def get(self):
+               _ = self.locale.translate
+
+               graphs = [
+                       ui.graphs.Graph(self, "context-switches"),
+               ]
+
+               self.render_graphs(graphs)
+
+
 class GraphExportHandler(base.BaseHandler):
        VALID_INTERVALS = ("hour", "day", "month", "week", "year")
        DEFAULT_INTERVAL = "day"