celery.utils.debug.rst 871 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ====================================
  2. ``celery.utils.debug``
  3. ====================================
  4. .. contents::
  5. :local:
  6. Sampling Memory Usage
  7. =====================
  8. This module can be used to diagnose and sample the memory usage
  9. used by parts of your application.
  10. For example, to sample the memory usage of calling tasks you can do this:
  11. .. code-block:: python
  12. from celery.utils.debug import sample_mem, memdump
  13. from tasks import add
  14. try:
  15. for i in range(100):
  16. for j in range(100):
  17. add.delay(i, j)
  18. sample_mem()
  19. finally:
  20. memdump()
  21. API Reference
  22. =============
  23. .. currentmodule:: celery.utils.debug
  24. .. automodule:: celery.utils.debug
  25. .. autofunction:: sample_mem
  26. .. autofunction:: memdump
  27. .. autofunction:: sample
  28. .. autofunction:: mem_rss
  29. .. autofunction:: ps