From 546a34b0c1f32c25b7511648ee481bb4f61ba648 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Tue, 16 Jan 2024 15:14:58 +0800 Subject: [PATCH] sync operation prints % of blocks matching --- pmtiles/makesync.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmtiles/makesync.go b/pmtiles/makesync.go index 7dd8fc7..a104bdd 100644 --- a/pmtiles/makesync.go +++ b/pmtiles/makesync.go @@ -342,9 +342,10 @@ func Sync(logger *log.Logger, file string, syncfile string) error { to_transfer += v.Length } + blocks_matched := float64(hits) / float64(total_blocks) * 100 pct := float64(to_transfer) / float64(total_remote_bytes) * 100 - fmt.Printf("%d/%d blocks matched, need to transfer %s/%s (%.1f%%).\n", hits, total_blocks, humanize.Bytes(to_transfer), humanize.Bytes(total_remote_bytes), pct) + fmt.Printf("%d/%d blocks matched (%.1f%%), need to transfer %s/%s (%.1f%%).\n", hits, total_blocks, blocks_matched, humanize.Bytes(to_transfer), humanize.Bytes(total_remote_bytes), pct) fmt.Printf("Completed sync in %v.\n", time.Since(start)) return nil