Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-reqs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ psycopg2
pylint
pythrifthiveapi
pyyaml
statsd
# Also install everything we need to build Sphinx docs
-r dev-reqs-for-docs.txt
2 changes: 2 additions & 0 deletions superset/stats_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def decr(self, key):
self.client.decr(key)

def gauge(self, key):
# pylint: disable=no-value-for-parameter
self.client.gauge(key)

except Exception as e:
pass
2 changes: 2 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
)

config = app.config
stats_logger = config.get('STATS_LOGGER')
log_this = models.Log.log_this
can_access = utils.can_access
DAR = models.DatasourceAccessRequest
Expand Down Expand Up @@ -2091,6 +2092,7 @@ def fetch_datasource_metadata(self):
@expose("/queries/<last_updated_ms>")
def queries(self, last_updated_ms):
"""Get the updated queries."""
stats_logger.incr('queries')
if not g.user.get_id():
return json_error_response(
"Please login to access the queries.", status=403)
Expand Down
3 changes: 3 additions & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from superset.utils import DTTM_ALIAS

config = app.config
stats_logger = config.get('STATS_LOGGER')


class BaseViz(object):
Expand Down Expand Up @@ -214,6 +215,7 @@ def get_payload(self, force=False):
payload = cache.get(cache_key)

if payload:
stats_logger.incr('loaded_from_source')
is_cached = True
try:
cached_data = zlib.decompress(payload)
Expand All @@ -227,6 +229,7 @@ def get_payload(self, force=False):
logging.info("Serving from cache")

if not payload:
stats_logger.incr('loaded_from_cache')
data = None
is_cached = False
cache_timeout = self.cache_timeout
Expand Down