From 10aee1432c2c925bf65a194e87671291d27d786e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 3 Jun 2018 13:20:19 -0400 Subject: cow-dedupe: Better dudupe statistics --- go/src/cow-dedupe/dedupe.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/go/src/cow-dedupe/dedupe.go b/go/src/cow-dedupe/dedupe.go index 742cd60..5717e30 100644 --- a/go/src/cow-dedupe/dedupe.go +++ b/go/src/cow-dedupe/dedupe.go @@ -180,15 +180,18 @@ func dedupe(srcFile string, dupFiles []string) error { type fancyStatus struct { sizeN, sizeD, sizeC int sumT, sumN, sumD, sumC int - summed, deduped, errs int + summed, errs int + deduped struct{ srcs, dstMaps, dstFiles int } verb string } func (s fancyStatus) String() string { - return fmt.Sprintf("size-set[%d/%d]->%d :: sha256-set[%d+%d/%d]->%d :: (sum=%d dedup=%d err=%d) :: %s", + return fmt.Sprintf("size-set[%d/%d]->%d :: sha256-set[%d+%d/%d]->%d :: (summed=%d deduped={%dmaps:%dfiles->%d} errs=%d) :: %s", s.sizeN, s.sizeD, s.sizeC, s.sumT, s.sumN, s.sumD, s.sumC, - s.summed, s.deduped, s.errs, + s.summed, + s.deduped.dstMaps+s.deduped.srcs, s.deduped.dstFiles+s.deduped.srcs, s.deduped.srcs, + s.errs, s.verb) } @@ -288,7 +291,9 @@ func main() { if err != nil { status.errs++ } else { - status.deduped++ + status.deduped.srcs++ + status.deduped.dstMaps += len(fiemaps) - 1 + status.deduped.dstFiles += len(dupFiles) } status.sumN++ } -- cgit v1.2.3-2-g168b