parent
0f22f008ed
commit
e7cdf2acbb
2 changed files with 10 additions and 1 deletions
6
changelog/unreleased/issue-2429
Normal file
6
changelog/unreleased/issue-2429
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Bugfix: backup --json reports total_bytes_processed as 0
|
||||||
|
|
||||||
|
We've fixed the json output of total_bytes_processed. The non-json output
|
||||||
|
was already fixed with pull request #2138 but left the json output untouched.
|
||||||
|
|
||||||
|
https://github.com/restic/restic/issues/2429
|
|
@ -49,6 +49,7 @@ type Backup struct {
|
||||||
Changed uint
|
Changed uint
|
||||||
Unchanged uint
|
Unchanged uint
|
||||||
}
|
}
|
||||||
|
ProcessedBytes uint64
|
||||||
archiver.ItemStats
|
archiver.ItemStats
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,6 +215,8 @@ func (b *Backup) CompleteItem(item string, previous, current *restic.Node, s arc
|
||||||
done: true,
|
done: true,
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
} else {
|
||||||
|
b.summary.ProcessedBytes += current.Size;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch current.Type {
|
switch current.Type {
|
||||||
|
@ -360,7 +363,7 @@ func (b *Backup) Finish(snapshotID restic.ID) {
|
||||||
TreeBlobs: b.summary.ItemStats.TreeBlobs,
|
TreeBlobs: b.summary.ItemStats.TreeBlobs,
|
||||||
DataAdded: b.summary.ItemStats.DataSize + b.summary.ItemStats.TreeSize,
|
DataAdded: b.summary.ItemStats.DataSize + b.summary.ItemStats.TreeSize,
|
||||||
TotalFilesProcessed: b.summary.Files.New + b.summary.Files.Changed + b.summary.Files.Unchanged,
|
TotalFilesProcessed: b.summary.Files.New + b.summary.Files.Changed + b.summary.Files.Unchanged,
|
||||||
TotalBytesProcessed: b.totalBytes,
|
TotalBytesProcessed: b.summary.ProcessedBytes,
|
||||||
TotalDuration: time.Since(b.start).Seconds(),
|
TotalDuration: time.Since(b.start).Seconds(),
|
||||||
SnapshotID: snapshotID.Str(),
|
SnapshotID: snapshotID.Str(),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue