data export: Add summary logging of runtime.

This should help us investigate cases where this runs a very long
time.
This commit is contained in:
Tim Abbott
2019-08-12 18:02:02 -07:00
parent 896886b412
commit 1d63f129bf

View File

@@ -611,6 +611,7 @@ class DeferredWorker(QueueProcessingWorker):
require_active=False)
do_mark_stream_messages_as_read(user_profile, client, stream)
elif event['type'] == 'realm_export':
start = time.time()
realm = Realm.objects.get(id=event['realm_id'])
output_dir = tempfile.mkdtemp(prefix="zulip-export-")
@@ -641,3 +642,5 @@ class DeferredWorker(QueueProcessingWorker):
# For future frontend use, also notify administrator
# clients that the export happened.
notify_realm_export(user_profile)
logging.info("Completed data export for %s in %s" % (
user_profile.realm.string_id, time.time() - start))