From 0da4e21caba6a630fea95827eb98d855a394872a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 12 Dec 2015 23:43:55 +0100 Subject: [PATCH] analytics: Add the context switches graph Signed-off-by: Michael Tremer --- src/westferry/handlers/analytics.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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" -- 2.39.2