Enabling profiling for the manager service

This guide explains how to enable and disable profiling for the manager service using the django-cprofile-middleware.

Enabling Profiling

To enable profiling you need to set the DEBUG environment variable to True.

Steps:

  1. Set the DEBUG environment variable to True.

  2. Run the service.
    Once the environment variable is set, start the service as usual. Profiling will be active.

  3. Access endpoints with profiling.
    To profile an endpoint, add the query parameter ?prof to the URL. For example:

    http://host:port/api/v1/endpoint?prof

Disabling Profiling

To disable profiling, simply set the DEBUG environment variable to False.

Steps:

  1. Set the DEBUG environment variable to False.
    You can set the environment variable as follows:

  2. Restart the service.
    After changing the DEBUG variable, restart the service for the changes to take effect. Profiling will be disabled.