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/10 17:32:02 UTC

[incubator-superset] branch master updated: add timing to stats logger (#5844)

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 e35bfba  add timing to stats logger (#5844)
e35bfba is described below

commit e35bfba308a1ed21226143c18feb4e11f5bec845
Author: timifasubaa <30...@users.noreply.github.com>
AuthorDate: Mon Sep 10 10:31:58 2018 -0700

    add timing to stats logger (#5844)
---
 superset/stats_logger.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/superset/stats_logger.py b/superset/stats_logger.py
index aaab8a1..e16ecbb 100644
--- a/superset/stats_logger.py
+++ b/superset/stats_logger.py
@@ -29,6 +29,9 @@ class BaseStatsLogger(object):
         """Decrement a counter"""
         raise NotImplementedError()
 
+    def timing(self, key, value):
+        raise NotImplementedError()
+
     def gauge(self, key):
         """Setup a gauge"""
         raise NotImplementedError()
@@ -44,6 +47,11 @@ class DummyStatsLogger(BaseStatsLogger):
             Fore.CYAN + '[stats_logger] (decr) ' + key +
             Style.RESET_ALL))
 
+    def timing(self, key, value):
+        logging.debug((
+            Fore.CYAN + '[stats_logger] (timing) {key} | {value} ' +
+            Style.RESET_ALL).format(**locals()))
+
     def gauge(self, key, value):
         logging.debug((
             Fore.CYAN + '[stats_logger] (gauge) '
@@ -63,6 +71,9 @@ try:
         def decr(self, key):
             self.client.decr(key)
 
+        def timing(self, key, value):
+            self.client.timing(key, value)
+
         def gauge(self, key):
             # pylint: disable=no-value-for-parameter
             self.client.gauge(key)