superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [incubator-superset] branch master updated: log query fetch time (#6033)
Date Thu, 04 Oct 2018 18:13:49 GMT
This is an automated email from the ASF dual-hosted git repository.

timi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e12d00a  log query fetch time (#6033)
e12d00a is described below

commit e12d00ae717534a442a12aee1e9f8151d9563242
Author: timifasubaa <30888507+timifasubaa@users.noreply.github.com>
AuthorDate: Thu Oct 4 11:13:32 2018 -0700

    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 a2732d1..4db788b 100644
--- a/superset/sql_lab.py
+++ b/superset/sql_lab.py
@@ -186,10 +186,14 @@ def execute_sql(
         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:


Mime
View raw message