You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ti...@apache.org on 2018/09/12 00:23:47 UTC

[incubator-superset] branch master updated: fix sqllab logging (#5862)

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 c82cea3  fix sqllab logging (#5862)
c82cea3 is described below

commit c82cea3c8d0bc612501adfeaecca0ad3bf25fe1e
Author: timifasubaa <30...@users.noreply.github.com>
AuthorDate: Tue Sep 11 17:23:44 2018 -0700

    fix sqllab logging (#5862)
---
 superset/sql_lab.py    | 2 +-
 superset/views/core.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/superset/sql_lab.py b/superset/sql_lab.py
index fff4271..8e2cafc 100644
--- a/superset/sql_lab.py
+++ b/superset/sql_lab.py
@@ -100,7 +100,7 @@ def execute_sql(
     user_name=None, session=None, start_time=None,
 ):
     """Executes the sql query returns the results."""
-    if store_results:
+    if store_results and start_time:
         # only asynchronous queries
         stats_logger.timing(
             'sqllab.query.time_pending', utils.now_as_float() - start_time)
diff --git a/superset/views/core.py b/superset/views/core.py
index e0260d1..e021709 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2338,7 +2338,7 @@ class Superset(BaseSupersetView):
         blob = results_backend.get(key)
         stats_logger.timing(
             'sqllab.query.results_backend_read',
-            read_from_results_backend_start - utils.now_as_float(),
+            utils.now_as_float() - read_from_results_backend_start,
         )
         if not blob:
             return json_error_response(