def rabbitmq_queue_size():
 from celery import current_app
 app = current_app._get_current_object()
 conn = app.connection()
 chan = conn.default_channel
 queue = chan.queue_declare('celery', passive=True)
 return queue.message_count

def rabbitmq_queue_size ( ) : from celery import current_app app = current_app . _get_current_object ( ) conn = app . connection ( ) chan = conn . default_channel queue = chan . queue_declare ( 'celery' , passive = True ) return queue . message_count
returns the rabbitmq queue size .