def __init__(self, stat_timer_name, **kwargs): self.dimensions = kwargs self._meteorite_timer = yelp_meteorite.create_timer( stat_timer_name, self.dimensions )
def create_timer(name, dimensions={}): if not METRICS_ENABLED: return if name not in _registered_metrics: timer = yelp_meteorite.create_timer( name, default_dimensions=dimensions) _registered_metrics[name] = timer
def _create_or_fake_timer(*args, **kwargs): """Create a Timer metric if yelp_meteorite is loaded (passing args), otherwise return a fake :return: Timer metric object """ try: return create_timer(*args, **kwargs) except NameError: return FakeMetric()
def create_timer(self, name: str, **kwargs: Any) -> TimerProtocol: return yelp_meteorite.create_timer(self.base_name + "." + name, kwargs)
def create_timer(name: str, *args: Any, **kwargs: Any) -> TimerProtocol: return yelp_meteorite.create_timer(name, *args, **kwargs)
def create_timer(self, name, **kwargs): return yelp_meteorite.create_timer('paasta.deployd.{}'.format(name), kwargs)
def get_timer_emitter(self, metric, default_dimensions=None): return yelp_meteorite.create_timer( metric, default_dimensions )
def __init__(self, stat_timer_name, **kwargs): self.dimensions = kwargs self._meteorite_timer = yelp_meteorite.create_timer( stat_timer_name, self.dimensions)