def get(self,request): instance = CeleryClient() response = instance.active_queues() if not response: return HttpResponse(json.dumps([]),content_type="application/json") else: return HttpResponse(json.dumps(response),content_type="application/json")
def get(self, request): command = self.request.GET.get('command', '') parameter = json.loads(self.request.GET.get('parameter', '')) instance = CeleryClient() response = instance.execute(command, parameter) return HttpResponse(json.dumps(response), content_type="application/json")
def get(self,request): import time a=time.time() instance = CeleryClient() b=time.time() response = instance.workers() c=time.time() #print b - a #print c - b #print c - a #print response # from django.utils import translation # user_language = 'zh-hans' ###user_language = 'en' # translation.activate(user_language) # request.session[translation.LANGUAGE_SESSION_KEY] = user_language return render_to_response('monitor/workers.html',locals())
def get(self,request): instance = CeleryClient() stats = instance.worker_stats active_tasks=instance.active_tasks() reserved_tasks=instance.reserved_tasks() revoked_tasks=instance.revoked_tasks() scheduled_tasks=instance.scheduled_tasks() return render_to_response('monitor/worker_status.html',locals())
def get(self,request): instance = CeleryClient() response = instance.active_queues() return render_to_response('monitor/queues_configuration.html',locals())
def get(self,request): instance = CeleryClient() stats = instance.worker_stats return render_to_response('monitor/pool_configuration.html',locals())
def get(self,request): instance = CeleryClient() response = instance.worker_registered_tasks() return render_to_response('monitor/task_configuration.html',locals())
def get(self,request): instance = CeleryClient() response = instance.reserved_tasks() title='Reserved Tasks' action = 'revoke' return render_to_response('monitor/active_tasks.html',locals())
def get(self,request): instance = CeleryClient() response = instance.active_tasks() title = 'Active Tasks' action = 'terminate' return render_to_response('monitor/active_tasks.html',locals())
def get(self,request): instance = CeleryClient() response = instance.registered_tasks() return render_to_response('monitor/registered_tasks.html',locals())
from client import CeleryClient from context import ContextManager from events import EventListener celery_client = CeleryClient() context_manager = ContextManager(client=celery_client) event_listener = EventListener(celery_client, context_manager, enable_events=True) event_listener.start()
def __init__(self, client=None): self._client = client or CeleryClient()