From: Michael Tremer Date: Sat, 12 Dec 2015 22:43:55 +0000 (+0100) Subject: analytics: Add the context switches graph X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0da4e21caba6a630fea95827eb98d855a394872a;p=people%2Fms%2Fwestferry.git analytics: Add the context switches graph Signed-off-by: Michael Tremer --- diff --git a/src/westferry/handlers/analytics.py b/src/westferry/handlers/analytics.py index 488b8d7..c098331 100644 --- a/src/westferry/handlers/analytics.py +++ b/src/westferry/handlers/analytics.py @@ -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"