From 4833e4a56659ab95617061bf3ba6b6ca35fb3e52 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 21 2019 11:09:18 +0000 Subject: Time the time it takes to build the bugzilla cache Signed-off-by: Pierre-Yves Chibon --- diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index a4949e6..ed98339 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -676,12 +676,19 @@ class DistgitBugzillaSync: times["FAS cache building end"] = time.time() delta = times["FAS cache building end"] - times["data structure end"] print(f"Ran for {delta} seconds -- ie: {delta/60} minutes") + print("Building bugzilla's products in-memory cache") + + bugzilla.build_product_cache(self.pagure_projects) + + if self.env["verbose"]: + times["BZ cache building end"] = time.time() + delta = times["BZ cache building end"] - times["FAS cache building end"] + print(f"Ran for {delta} seconds -- ie: {delta/60} minutes") if self.env["dryrun"]: print("Querying bugzilla but not doing anything") else: print("Updating bugzilla") - bugzilla.build_product_cache(self.pagure_projects) for project in sorted(self.pagure_projects, key=itemgetter('name')): for product in project["products"]: if product not in self.env['products']: @@ -754,8 +761,12 @@ class DistgitBugzillaSync: delta = times["FAS cache building end"] - times["data structure end"] print(f" Ran on {delta:.2f} seconds -- ie: {delta/60:.2f} minutes") + print("Building the bugzilla cache") + delta = times["BZ cache building end"] - times["FAS cache building end"] + print(f" Ran on {delta:.2f} seconds -- ie: {delta/60:.2f} minutes") + print("Interacting with bugzilla") - delta = times["end"] - times["FAS cache building end"] + delta = times["end"] - times["BZ cache building end"] print(f" Ran on {delta:.2f} seconds -- ie: {delta/60:.2f} minutes") print("Total")