# HG changeset patch # User RhodeCode Admin # Date 2022-10-27 20:48:29 # Node ID 68a8ca72d2031a65597dc4fb5cd0de8b9cfa6cec # Parent a6b2d02d004718d26046bf91ae534d1242075d3b libs: synced with ce codebase diff --git a/vcsserver/lib/_vendor/redis_lock/__init__.py b/vcsserver/lib/_vendor/redis_lock/__init__.py --- a/vcsserver/lib/_vendor/redis_lock/__init__.py +++ b/vcsserver/lib/_vendor/redis_lock/__init__.py @@ -221,7 +221,7 @@ class Lock(object): """ logger = loggers["acquire"] - logger.debug("Getting acquire on %r ...", self._name) + logger.debug("Getting blocking: %s acquire on %r ...", blocking, self._name) if self._held: owner_id = self.get_owner_id() @@ -252,7 +252,7 @@ class Lock(object): logger.warning("Failed to get %r.", self._name) return False - logger.info("Got lock for %r.", self._name) + logger.debug("Got lock for %r.", self._name) if self._lock_renewal_interval is not None: self._start_lock_renewer() return True diff --git a/vcsserver/lib/_vendor/statsd/base.py b/vcsserver/lib/_vendor/statsd/base.py --- a/vcsserver/lib/_vendor/statsd/base.py +++ b/vcsserver/lib/_vendor/statsd/base.py @@ -45,6 +45,15 @@ class StatsClientBase(object): raise NotImplementedError() def timer(self, stat, rate=1, tags=None): + """ + statsd = StatsdClient() + with statsd.timer('bucket_name', auto_send=True) as tmr: + # This block will be timed. + for i in xrange(0, 100000): + i ** 2 + # you can access time here... + elapsed_ms = tmr.ms + """ return Timer(self, stat, rate, tags) def timing(self, stat, delta, rate=1, tags=None, use_decimals=True):