Log collection time taken

Change-Id: I3a94b70d4cbfa229dfa998d7058792f6ea8db0fa
This commit is contained in:
Adrian Turjak 2020-03-16 16:52:43 +13:00
parent 102e88fab5
commit 07f09a1a9e
1 changed files with 4 additions and 0 deletions

View File

@ -111,6 +111,7 @@ class CollectorService(service.Service):
def collect_usage(self):
LOG.info("Starting to collect usage...")
collection_start = datetime.utcnow()
if CONF.collector.max_windows_per_cycle <= 0:
LOG.info("Finished collecting usage with configuration "
@ -173,6 +174,9 @@ class CollectorService(service.Service):
LOG.warning('Get lock failed. Process: %s' % self.identifier)
LOG.info("Finished collecting usage for %s projects." % success_count)
collection_end = datetime.utcnow()
collection_taken = collection_end - collection_start
LOG.info("Collection time was: %ss." % collection_taken.seconds)
# If we start distil-collector manually with 'collect_end_time' param
# specified, the service should be stopped automatically after all