summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@beefcake.parabola.nu>2018-06-03 13:20:19 -0400
committerLuke Shumaker <lukeshu@beefcake.parabola.nu>2018-06-03 14:07:47 -0400
commit10aee1432c2c925bf65a194e87671291d27d786e (patch)
treed11f0f317996570c73163506c61b46a6ea4834d0
parent65760565fd8b6d72f7a31bfe8ffda4386fc8d8de (diff)
cow-dedupe: Better dudupe statistics
-rw-r--r--go/src/cow-dedupe/dedupe.go13
1 files 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++
}