From e12d00ae717534a442a12aee1e9f8151d9563242 Mon Sep 17 00:00:00 2001 From: timifasubaa <30888507+timifasubaa@users.noreply.github.com> Date: Thu, 4 Oct 2018 11:13:32 -0700 Subject: [PATCH] log query fetch time (#6033) --- superset/sql_lab.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/superset/sql_lab.py b/superset/sql_lab.py index a2732d17c5031..4db788b14a65f 100644 --- a/superset/sql_lab.py +++ b/superset/sql_lab.py @@ -186,10 +186,14 @@ def handle_error(msg): logging.info('Handling cursor') db_engine_spec.handle_cursor(cursor, query, session) logging.info('Fetching data: {}'.format(query.to_dict())) - data = db_engine_spec.fetch_data(cursor, query.limit) stats_logger.timing( 'sqllab.query.time_executing_query', now_as_float() - query_start_time) + fetching_start_time = now_as_float() + data = db_engine_spec.fetch_data(cursor, query.limit) + stats_logger.timing( + 'sqllab.query.time_fetching_results', + now_as_float() - fetching_start_time) except SoftTimeLimitExceeded as e: logging.exception(e) if conn is not None: