From 52cb25070142f6648c759996cdafe992ae37d94a Mon Sep 17 00:00:00 2001 From: Florian Sesser Date: Fri, 27 Aug 2021 16:42:23 +0000 Subject: [PATCH] This is the handler we need to create. --- src/allmydata/web/status.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/allmydata/web/status.py b/src/allmydata/web/status.py index 158d897f9..8c78b1156 100644 --- a/src/allmydata/web/status.py +++ b/src/allmydata/web/status.py @@ -1551,6 +1551,21 @@ class Statistics(MultiFormatResource): req.setHeader("content-type", "text/plain") return json.dumps(stats, indent=1) + "\n" + @render_exception + def render_OPENMETRICS(self, req): + req.setHeader("content-type", "application/openmetrics-text") + return "3. occurence. This should be the one.\n" + + # @render_exception + # def render_OPENMETRICS(self, req): + # req.setHeader("content-type", "text/plain") + # if self._helper: + # stats = self._helper.get_stats() + # import pprint + # return pprint.PrettyPrinter().pprint(stats) + "\n" + # return "uh oh\n" + + class StatisticsElement(Element): loader = XMLFile(FilePath(__file__).sibling("statistics.xhtml"))