service
dev_tool.services.django.profiling.service
log = logging.getLogger(__name__)
module-attribute
ProfilingService
Bases: BaseService
A service class for Django profiling operations using pyinstrument.
This class provides methods for managing Django profiling with pyinstrument which generates its own HTML visualizations.
The constructor for the ProfilingService class.
It initializes the profiling service with package managers and creates the profile output directory.
Source code in dev_tool/services/django/profiling/service.py
directory = BASE / '.profile'
instance-attribute
inject_profiling_middleware
A method that injects profiling middleware into the Django application.
This method sets environment variables for pyinstrument profiling.
Raises:
-
ProfilingMiddlewareError–If middleware injection fails.
Source code in dev_tool/services/django/profiling/service.py
open_profile_directory
A method that opens the profile directory in the system file browser.