Skip to content

Commit ec061de

Browse files
committed
Add logging for times to save a document with history. Commit ready for merge.
- Legacy-Id: 18698
1 parent 0bf56c9 commit ec061de

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ietf/doc/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io
88
import os
99
import rfc2html
10+
import time
1011

1112
from django.db import models
1213
from django.core import checks
@@ -715,12 +716,16 @@ def save_with_history(self, events):
715716
assert events, "You must always add at least one event to describe the changes in the history log"
716717
self.time = max(self.time, events[0].time)
717718

719+
mark = time.time()
718720
self._has_an_event_so_saving_is_allowed = True
719721
self.save()
720722
del self._has_an_event_so_saving_is_allowed
723+
log.log(f'{time.time()-mark:.3f} seconds to save Document object')
721724

725+
mark = time.time()
722726
from ietf.doc.utils import save_document_in_history
723727
save_document_in_history(self)
728+
log.log(f'{time.time()-mark:.3f} seconds to save Document in history')
724729

725730
def save(self, *args, **kwargs):
726731
# if there's no primary key yet, we can allow the save to go

0 commit comments

Comments
 (0)