mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 04:45:15 +00:00
Extend cmd/split
This commit is contained in:
parent
878a96e761
commit
16dfd73ecb
@ -31,22 +31,23 @@ func main() {
|
||||
for {
|
||||
chunk, err := ch.Next()
|
||||
|
||||
if chunk != nil {
|
||||
fmt.Printf("%d %016x %02x\n", chunk.Length, chunk.Cut, sha256.Sum256(chunk.Data))
|
||||
count++
|
||||
bytes += chunk.Length
|
||||
|
||||
if chunk.Length == chunker.MaxSize {
|
||||
max++
|
||||
} else if chunk.Length == chunker.MinSize {
|
||||
min++
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Printf("%d %016x %02x\n", chunk.Length, chunk.Cut, sha256.Sum256(chunk.Data))
|
||||
count++
|
||||
bytes += chunk.Length
|
||||
|
||||
if chunk.Length == chunker.MaxSize {
|
||||
max++
|
||||
} else if chunk.Length == chunker.MinSize {
|
||||
min++
|
||||
}
|
||||
}
|
||||
|
||||
var avg int
|
||||
@ -54,6 +55,6 @@ func main() {
|
||||
avg = bytes / count
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stderr, "%d chunks, average size %d (%d min size, %d max size chunks)\n",
|
||||
count, avg, min, max)
|
||||
fmt.Fprintf(os.Stderr, "%d chunks from %d bytes, average size %d (%d min size, %d max size chunks)\n",
|
||||
count, bytes, avg, min, max)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user