From 75d51326df4e8d4c2e162b3eda16b68f615b2d0a Mon Sep 17 00:00:00 2001 From: Kiran Jonnalagadda Date: Fri, 28 Jul 2023 16:18:21 +0530 Subject: [PATCH] More docstrings --- src/baseframe/statsd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/baseframe/statsd.py b/src/baseframe/statsd.py index 232625b2..2b9d7061 100644 --- a/src/baseframe/statsd.py +++ b/src/baseframe/statsd.py @@ -226,10 +226,12 @@ def pipeline(self) -> Pipeline: @staticmethod def _request_started(app: Flask) -> None: + """Record start time when serving a request.""" if app.config['STATSD_RATE'] != 0: setattr(g, REQUEST_START_TIME_ATTR, time.time()) def _request_finished(self, app: Flask, response: Response) -> None: + """Calculate time to render a response and log to statsd.""" if hasattr(g, REQUEST_START_TIME_ATTR): start_time = getattr(g, REQUEST_START_TIME_ATTR) metrics = [