mik-laj commented on a change in pull request #5139: [AIRFLOW-4360] Add
performance metrics for Webserver UI.
URL: https://github.com/apache/airflow/pull/5139#discussion_r281043446
##########
File path: airflow/www/decorators.py
##########
@@ -125,3 +127,29 @@ def wrapper(self, *args, **kwargs):
__class__.__name__ + ".login"))
return wrapper
return decorator
+
+
+def log_webserver_stats(endpoint, log_views=False, log_duration=False,
log_failures=False):
+ """
+ Decorator to log server side stats from webserver UI.
+
+ Currently supports logging views and load failures as counters
+ and load duration as timing.
+ """
+ def decorator(f):
+ @functools.wraps(f)
+ def wrapper(*args, **kwargs):
+ start_dttm = timezone.utcnow()
+ if (log_views):
Review comment:
```suggestion
if log_views:
```
These brackets are unnecessary
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services