##// END OF EJS Templates
libs: synced with ce codebase
super-admin -
r1018:68a8ca72 default
parent child Browse files
Show More
@@ -221,7 +221,7 b' class Lock(object):'
221 221 """
222 222 logger = loggers["acquire"]
223 223
224 logger.debug("Getting acquire on %r ...", self._name)
224 logger.debug("Getting blocking: %s acquire on %r ...", blocking, self._name)
225 225
226 226 if self._held:
227 227 owner_id = self.get_owner_id()
@@ -252,7 +252,7 b' class Lock(object):'
252 252 logger.warning("Failed to get %r.", self._name)
253 253 return False
254 254
255 logger.info("Got lock for %r.", self._name)
255 logger.debug("Got lock for %r.", self._name)
256 256 if self._lock_renewal_interval is not None:
257 257 self._start_lock_renewer()
258 258 return True
@@ -45,6 +45,15 b' class StatsClientBase(object):'
45 45 raise NotImplementedError()
46 46
47 47 def timer(self, stat, rate=1, tags=None):
48 """
49 statsd = StatsdClient()
50 with statsd.timer('bucket_name', auto_send=True) as tmr:
51 # This block will be timed.
52 for i in xrange(0, 100000):
53 i ** 2
54 # you can access time here...
55 elapsed_ms = tmr.ms
56 """
48 57 return Timer(self, stat, rate, tags)
49 58
50 59 def timing(self, stat, delta, rate=1, tags=None, use_decimals=True):
General Comments 0
You need to be logged in to leave comments. Login now