diff options
author | Marko Kreen | 2013-06-19 20:20:08 +0000 |
---|---|---|
committer | Marko Kreen | 2013-06-19 20:20:08 +0000 |
commit | 7613072009ff79c4b9a5b9064fd697fcd4cf0d7f (patch) | |
tree | 9dd86664eb45e6f0338fc121e5c71e75c07887c2 | |
parent | 46d6db36a03967dfab96b0dc035a9f1c5088d134 (diff) |
londiste --wait-sync: show progress in absolute numbers
This gives more information and is less random.
-rw-r--r-- | python/londiste/setup.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/python/londiste/setup.py b/python/londiste/setup.py index aba6cd93..3ce5446d 100644 --- a/python/londiste/setup.py +++ b/python/londiste/setup.py @@ -660,18 +660,19 @@ class LondisteSetup(CascadeAdmin): dst_curs = dst_db.cursor() partial = {} - done_pos = 1 startup_info = 0 while 1: dst_curs.execute(q, [self.queue_name]) rows = dst_curs.fetchall() dst_db.commit() + total_count = 0 cur_count = 0 done_list = [] for row in rows: if not row['local']: continue + total_count += 1 tbl = row['table_name'] if row['merge_state'] != 'ok': partial[tbl] = 0 @@ -681,13 +682,14 @@ class LondisteSetup(CascadeAdmin): partial[tbl] = 1 done_list.append(tbl) + done_count = total_count - cur_count + if not startup_info: - self.log.info("%d table(s) to copy", len(partial)) + self.log.info("%d/%d table(s) to copy", cur_count, total_count) startup_info = 1 for done in done_list: - self.log.info("%s: finished (%d/%d)", done, done_pos, len(partial)) - done_pos += 1 + self.log.info("%s: finished (%d/%d)", done, done_count, total_count) if cur_count == 0: break |