From 6e89294bbe7655d710ae1b6fc7d49cb61793fad4 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 8 Oct 2019 22:12:27 +0000 Subject: [PATCH 1/2] Fix format --- cufacesearch/cufacesearch/ingester/kinesis_ingester.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cufacesearch/cufacesearch/ingester/kinesis_ingester.py b/cufacesearch/cufacesearch/ingester/kinesis_ingester.py index f80417f..56c0d75 100644 --- a/cufacesearch/cufacesearch/ingester/kinesis_ingester.py +++ b/cufacesearch/cufacesearch/ingester/kinesis_ingester.py @@ -262,7 +262,7 @@ def get_msg_json(self): print(msg.format(self.pp, len(records))) if self.verbose > 4: lag_ms = rec_response['MillisBehindLatest'] - msg = "[{}: log] Lagging by {.3f}s" + msg = "[{}: log] Lagging by {:.2f}s" print(msg.format(self.pp, lag_ms/1000.0)) sleep_count = 0 for rec in records: @@ -323,4 +323,4 @@ def get_msg_json(self): time.sleep(1) except Exception as inst: msg = "[{}: ERROR] get_msg_json failed with error {}" - print(msg.format(self.pp, inst)) \ No newline at end of file + print(msg.format(self.pp, inst)) From 45f45be1e808a2d52862cd17ff08f298078e0d5b Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 9 Oct 2019 19:09:12 +0000 Subject: [PATCH 2/2] output time to check unprocessed images --- cufacesearch/cufacesearch/updater/extraction_checker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cufacesearch/cufacesearch/updater/extraction_checker.py b/cufacesearch/cufacesearch/updater/extraction_checker.py index 98558b7..b442ee0 100644 --- a/cufacesearch/cufacesearch/updater/extraction_checker.py +++ b/cufacesearch/cufacesearch/updater/extraction_checker.py @@ -323,7 +323,12 @@ def run(self, daemon=False): if list_check_sha1s: # Check which images have not been processed (or pushed in an update) yet + # This seems slow + start_check = time.time() unprocessed_rows = self.get_unprocessed_rows(list_check_sha1s) + msg = "[{}: log] Found {}/{} unprocessed images in {:.2f}s" + print(msg.format(self.pp, len(unprocessed_rows), len(list_check_sha1s), time.time() - start_check)) + #unprocessed_rows = self.get_unprocessed_rows(list_check_sha1s) self.nb_imgs_check += len(list_check_sha1s) push_delay = (time.time() - self.last_push) > self.max_delay / 60 if push_delay and self.nb_imgs_unproc_lastprint != self.nb_imgs_unproc: