Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync operation prints % of blocks matching #119

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pmtiles/makesync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down