celery.utils.debug

    E.g to sample the memory usage of calling tasks you can do this:

    API Reference

    Utilities for debugging memory usage.

    celery.utils.debug.sample_mem()

    Sample RSS memory usage.

    celery.utils.debug.memdump(samples=10, file=None)[源代码]

    Dump memory statistics.

    Will print a sample of all RSS memory samples added by calling , and in addition print used RSS memory after gc.collect().

    celery.utils.debug.sample(x, n, k=0)

    E.g. if n is 10, and x has 100 items, a list of every 10th item is returned.

    k can be used as offset.

    celery.utils.debug.mem_rss()[源代码]

    Return RSS memory usage as a humanized string.

    Return the global psutil.Process instance, or None if psutil is not installed.