@task()
@timeit
def measure_queue_lag(queued_time):
 lag = (datetime.now() - queued_time)
 lag = (((lag.days * 3600) * 24) + lag.seconds)
 statsd.gauge('rabbitmq.lag', max(lag, 0))

@ task ( ) @ timeit def measure_queue_lag ( queued_time ) : lag = ( datetime . now ( ) - queued_time ) lag = ( ( ( lag . days * 3600 ) * 24 ) + lag . seconds ) statsd . gauge ( 'rabbitmq.lag' , max ( lag , 0 ) )
a task that measures the time it was sitting in the queue .