Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
add timing to stats logger (apache#5844)
Browse files Browse the repository at this point in the history
  • Loading branch information
timifasubaa authored Sep 10, 2018
1 parent f740974 commit e35bfba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions superset/stats_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def decr(self, key):
"""Decrement a counter"""
raise NotImplementedError()

def timing(self, key, value):
raise NotImplementedError()

def gauge(self, key):
"""Setup a gauge"""
raise NotImplementedError()
Expand All @@ -44,6 +47,11 @@ def decr(self, key):
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) '
Expand All @@ -63,6 +71,9 @@ def incr(self, key):
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)
Expand Down

0 comments on commit e35bfba

Please sign in to comment.