1. hideki nara
  2. django-celery-about

Source

django-celery-about / source / monitor.rst

モニタリング

manage.py celerycam:イベント記録プロセスの起動

-F / --frequency

$ python ../manage.py celerycam -F 2.0

[2012-09-01 03:28:05,420: INFO/MainProcess]
-> evcam: Taking snapshots with djcelery.snapshot.Camera (every 2.0 secs.)

Workerにイベントを送出させる

-E / --events オプション

$ python ../manage.py celery worker --loglevel=DEBUG -E
--------------  celery@wzy v3.0.8 (Chiastic Slide)
---- **** -----
--- * ***  * -- [Configuration]
-- * - **** --- . broker:      amqp://guest@localhost:5672//
- ** ---------- . app:         default:0x2065550 (djcelery.loaders.DjangoLoader)
- ** ---------- . concurrency: 1 (processes)
- ** ---------- . events:      ON
- ** ----------
- *** --- * --- [Queues]
-- ******* ---- . soup:        exchange:soup(direct) binding:soup
--- ***** -----

enable_events()

>>> from celery import current_app as C
>>> C.control.enable_events()

Workerのログにでます:

[2012-09-01 04:11:20,386: INFO/MainProcess] Events enabled by remote.

manage.py celery control enable_events

うまく行ってない:

$ python ../manage.py celery control enable_events
Error: No nodes replied within time constraint.

django-celery : Django Admin UI

djcelery.models.TaskState

>>> from djcelery.models import  TaskState

>>> TaskState.objects.all().update(hidden=True)

>>> TaskState.objects.purge()

>>> TaskState.objects.all().delete()

djcelery.models.WorkerState

>>> from djcelery.models import WorkerState, TaskState

# delete worker history
>>> WorkerState.objects.all().delete()