Skip to content

Commit

Permalink
log query fetch time (apache#6033)
Browse files Browse the repository at this point in the history
  • Loading branch information
timifasubaa authored Oct 4, 2018
1 parent ab5c910 commit e12d00a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion superset/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e12d00a

Please sign in to comment.