Skip to content

Commit 871f161

Browse files
committed
Show elapsed time for build and publishing
1 parent 2135304 commit 871f161

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

build_docs.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ def translation_branch(self):
702702
def build(self):
703703
"""Build this version/language doc."""
704704
logging.info("Build start.")
705+
start_time = perf_counter()
705706
sphinxopts = list(self.language.sphinxopts)
706707
sphinxopts.extend(["-q"])
707708
if self.language.tag != "en":
@@ -778,7 +779,7 @@ def is_mac():
778779
setup_switchers(
779780
self.versions, self.languages, self.checkout / "Doc" / "build" / "html"
780781
)
781-
logging.info("Build done.")
782+
logging.info("Build done (%.1f minutes).", (perf_counter() - start_time) / 60)
782783

783784
def build_venv(self):
784785
"""Build a venv for the specific Python version.
@@ -800,6 +801,7 @@ def build_venv(self):
800801
def copy_build_to_webroot(self):
801802
"""Copy a given build to the appropriate webroot with appropriate rights."""
802803
logging.info("Publishing start.")
804+
start_time = perf_counter()
803805
self.www_root.mkdir(parents=True, exist_ok=True)
804806
if self.language.tag == "en":
805807
target = self.www_root / self.version.name
@@ -912,7 +914,9 @@ def copy_build_to_webroot(self):
912914
purge(*prefixes)
913915
for prefix in prefixes:
914916
purge(*[prefix + p for p in changed])
915-
logging.info("Publishing done")
917+
logging.info(
918+
"Publishing done (%.1f minutes).", (perf_counter() - start_time) / 60
919+
)
916920

917921
def should_rebuild(self):
918922
state = self.load_state()

0 commit comments

Comments
 (0)