[Viz/Query] Improve logging around cache hits (#9058)

This commit is contained in:
Erik Ritter
2020-01-31 08:46:12 -08:00
committed by GitHub
parent 47eecb84f5
commit c214cf1a43
2 changed files with 4 additions and 2 deletions

View File

@@ -187,13 +187,14 @@ class QueryContext:
if cache_key and cache and not self.force:
cache_value = cache.get(cache_key)
if cache_value:
stats_logger.incr("loaded_from_cache")
stats_logger.incr("loading_from_cache")
try:
cache_value = pkl.loads(cache_value)
df = cache_value["df"]
query = cache_value["query"]
status = utils.QueryStatus.SUCCESS
is_loaded = True
stats_logger.incr("loaded_from_cache")
except Exception as e: # pylint: disable=broad-except
logging.exception(e)
logging.error(