コード例 #1
0
 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")
コード例 #2
0
ファイル: views.py プロジェクト: jpgzs/celery-monitor
 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")
コード例 #3
0
 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())
コード例 #4
0
 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())
コード例 #5
0
 def get(self,request):
     instance = CeleryClient()
     response = instance.active_queues()
     return render_to_response('monitor/queues_configuration.html',locals())
コード例 #6
0
 def get(self,request):
     instance = CeleryClient()
     stats = instance.worker_stats
     return render_to_response('monitor/pool_configuration.html',locals())
コード例 #7
0
 def get(self,request):
     instance = CeleryClient()
     response = instance.worker_registered_tasks()
     return render_to_response('monitor/task_configuration.html',locals())
コード例 #8
0
 def get(self,request):
     instance = CeleryClient()
     response = instance.reserved_tasks()
     title='Reserved Tasks'
     action = 'revoke'
     return render_to_response('monitor/active_tasks.html',locals())
コード例 #9
0
 def get(self,request):
     instance = CeleryClient()
     response = instance.active_tasks()
     title = 'Active Tasks'
     action = 'terminate'
     return render_to_response('monitor/active_tasks.html',locals())
コード例 #10
0
 def get(self,request):
     instance = CeleryClient()
     response = instance.registered_tasks()
     return render_to_response('monitor/registered_tasks.html',locals())
コード例 #11
0
ファイル: __init__.py プロジェクト: morisecret/djcelery-admin
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()
コード例 #12
0
 def __init__(self, client=None):
     self._client = client or CeleryClient()