(key, timeout=None, name=None, track_unreleased=True, **kw)
return MeteredLock(lock, name, track_unreleased)
Get redis lock with datadog timing metrics

    :param key: Redis lock name.
    :param timeout: Timeout passed through to redis lock.
    :param name: Datadog "lock_name" tag value. This should be just
    specific enough to identify the area of code that acquired the lock,
    but not so specific that it will multiply the number of tags in
    datadog unnecessarily.
    :param track_unreleased: When true (the default), increase the count
    of unreleased locks if a lock object is garbage-collected before it
    is released.
    :param **kw: Keyword arguments to be passed through to redis when
    creating the new lock.
Get redis lock with datadog timing metrics
Get redis lock with datadog timing metrics
def get_redis_lock(key, timeout=None, name=None, track_unreleased=True, **kw):
    """Get redis lock with datadog timing metrics

    :param key: Redis lock name.
    :param timeout: Timeout passed through to redis lock.
    :param name: Datadog "lock_name" tag value. This should be just
    specific enough to identify the area of code that acquired the lock,
    but not so specific that it will multiply the number of tags in
    datadog unnecessarily.
    :param track_unreleased: When true (the default), increase the count
    of unreleased locks if a lock object is garbage-collected before it
    is released.
    :param **kw: Keyword arguments to be passed through to redis when
    creating the new lock.
    """
    if name is None:
        raise ValueError("'name' (DataDog 'name' tag value) is required")
    lock = get_redis_client().lock(key, timeout=timeout, **kw)
    return MeteredLock(lock, name, track_unreleased)
def get_redis_lock ( key , timeout = None , name = None , track_unreleased = True , * * kw ) : if name is None : raise ValueError ( "'name' (DataDog 'name' tag value) is required" ) lock = get_redis_client ( ) . lock ( key , timeout = timeout , * * kw ) return MeteredLock ( lock , name , track_unreleased )