mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-21 03:49:22 +02:00
Add timers
This commit is contained in:
parent
e265008bc8
commit
b5784a1a88
2 changed files with 106 additions and 99 deletions
|
@ -32,6 +32,7 @@ from django.contrib.auth.forms import UserChangeForm, UsernameField
|
|||
from django_admin_multiple_choice_list_filter.list_filters import MultipleChoiceListFilter
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from registrar.models.utility.generic_helper import Timer
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -2027,6 +2028,8 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
return HttpResponseRedirect(reverse("domain", args=(obj.id,)))
|
||||
|
||||
def change_view(self, request, object_id):
|
||||
logger.info("Timing change_view on domain")
|
||||
with Timer():
|
||||
# If the analyst was recently editing a domain page,
|
||||
# delete any associated session values
|
||||
if "analyst_action" in request.session:
|
||||
|
|
|
@ -13,7 +13,7 @@ from django.db.models.functions import Concat, Coalesce
|
|||
from registrar.models.public_contact import PublicContact
|
||||
from registrar.models.user_domain_role import UserDomainRole
|
||||
from registrar.utility.enums import DefaultEmail
|
||||
|
||||
from registrar.models.utility.generic_helper import Timer
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -379,7 +379,8 @@ def write_csv_for_requests(
|
|||
|
||||
def export_data_type_to_csv(csv_file):
|
||||
"""All domains report with extra columns"""
|
||||
|
||||
logger.info("Timing export_data_type_to_csv")
|
||||
with Timer():
|
||||
writer = csv.writer(csv_file)
|
||||
# define columns to include in export
|
||||
columns = [
|
||||
|
@ -419,6 +420,8 @@ def export_data_type_to_csv(csv_file):
|
|||
def export_data_full_to_csv(csv_file):
|
||||
"""All domains report"""
|
||||
|
||||
logger.info("Timing def export_data_full_to_csv")
|
||||
with Timer():
|
||||
writer = csv.writer(csv_file)
|
||||
# define columns to include in export
|
||||
columns = [
|
||||
|
@ -451,7 +454,8 @@ def export_data_full_to_csv(csv_file):
|
|||
|
||||
def export_data_federal_to_csv(csv_file):
|
||||
"""Federal domains report"""
|
||||
|
||||
logger.info("Timing def export_data_federal_to_csv")
|
||||
with Timer():
|
||||
writer = csv.writer(csv_file)
|
||||
# define columns to include in export
|
||||
columns = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue