From 96a7cc3372c70380f91e69d3b07a03b7818ac7f2 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 31 Aug 2022 14:50:14 +0200 Subject: [PATCH] Logging: log time spent to upload build artifacts Start collecting how much time (in seconds) it takes to upload all the build artifacts for each project. Related #9448 --- readthedocs/projects/tasks/builds.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/readthedocs/projects/tasks/builds.py b/readthedocs/projects/tasks/builds.py index 15a8ed89abb..d0d066afa83 100644 --- a/readthedocs/projects/tasks/builds.py +++ b/readthedocs/projects/tasks/builds.py @@ -517,6 +517,7 @@ def on_success(self, retval, task_id, args, kwargs): pdf = self.data.outcomes['pdf'] epub = self.data.outcomes['epub'] + time_before_store_build_artifacts = timezone.now() # Store build artifacts to storage (local or cloud storage) self.store_build_artifacts( html=html, @@ -525,6 +526,10 @@ def on_success(self, retval, task_id, args, kwargs): pdf=pdf, epub=epub, ) + log.info( + "Store build artifacts finished.", + time=(timezone.now() - time_before_store_build_artifacts).seconds, + ) # NOTE: we are updating the db version instance *only* when # HTML are built successfully.