mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-20 09:46:06 +02:00
Add some timing
This commit is contained in:
parent
a51949da0b
commit
ee41a8ac73
1 changed files with 47 additions and 37 deletions
|
@ -205,9 +205,13 @@ class ListHeaderAdmin(AuditedAdmin, OrderableFieldsMixin):
|
||||||
|
|
||||||
Reference: https://code.djangoproject.com/ticket/31975
|
Reference: https://code.djangoproject.com/ticket/31975
|
||||||
"""
|
"""
|
||||||
|
logger.info("timing get_changelist")
|
||||||
|
with Timer() as t:
|
||||||
return MultiFieldSortableChangeList
|
return MultiFieldSortableChangeList
|
||||||
|
|
||||||
def changelist_view(self, request, extra_context=None):
|
def changelist_view(self, request, extra_context=None):
|
||||||
|
logger.info("timing changelist_view")
|
||||||
|
with Timer() as t:
|
||||||
if extra_context is None:
|
if extra_context is None:
|
||||||
extra_context = {}
|
extra_context = {}
|
||||||
# Get the filtered values
|
# Get the filtered values
|
||||||
|
@ -224,7 +228,8 @@ class ListHeaderAdmin(AuditedAdmin, OrderableFieldsMixin):
|
||||||
parameter_value: string}
|
parameter_value: string}
|
||||||
TODO: convert investigator id to investigator username
|
TODO: convert investigator id to investigator username
|
||||||
"""
|
"""
|
||||||
|
logger.info("timing get_filters")
|
||||||
|
with Timer() as t:
|
||||||
filters = []
|
filters = []
|
||||||
# Retrieve the filter parameters
|
# Retrieve the filter parameters
|
||||||
for param in request.GET.keys():
|
for param in request.GET.keys():
|
||||||
|
@ -803,6 +808,11 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
||||||
else:
|
else:
|
||||||
return queryset.filter(investigator__id__exact=self.value())
|
return queryset.filter(investigator__id__exact=self.value())
|
||||||
|
|
||||||
|
def __new__(self, *args, **kwargs):
|
||||||
|
logger.info("timing __new__")
|
||||||
|
with Timer() as t:
|
||||||
|
return super().__new__(self, *args, **kwargs)
|
||||||
|
|
||||||
# Columns
|
# Columns
|
||||||
list_display = [
|
list_display = [
|
||||||
"requested_domain",
|
"requested_domain",
|
||||||
|
@ -905,7 +915,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
||||||
def formfield_for_manytomany(self, db_field, request, **kwargs):
|
def formfield_for_manytomany(self, db_field, request, **kwargs):
|
||||||
logger.info("timing formfield_for_manytomany")
|
logger.info("timing formfield_for_manytomany")
|
||||||
with Timer() as t:
|
with Timer() as t:
|
||||||
if db_field.name in ("current_websites", "alternative_domains"):
|
if db_field.name in {"current_websites", "alternative_domains"}:
|
||||||
kwargs["queryset"] = models.Website.objects.all().order_by("website") # Sort websites
|
kwargs["queryset"] = models.Website.objects.all().order_by("website") # Sort websites
|
||||||
return super().formfield_for_manytomany(db_field, request, **kwargs)
|
return super().formfield_for_manytomany(db_field, request, **kwargs)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue