Initial implementation of JSON progress reporter

This commit is contained in:
Matthew Holt
2018-08-10 23:34:37 -06:00
committed by Alexander Neumann
parent 1107eef215
commit f645306a18
4 changed files with 511 additions and 16 deletions

View File

@@ -254,9 +254,9 @@ func formatBytes(c uint64) string {
}
}
// CompleteItemFn is the status callback function for the archiver when a
// CompleteItem is the status callback function for the archiver when a
// file/dir has been saved successfully.
func (b *Backup) CompleteItemFn(item string, previous, current *restic.Node, s archiver.ItemStats, d time.Duration) {
func (b *Backup) CompleteItem(item string, previous, current *restic.Node, s archiver.ItemStats, d time.Duration) {
b.summary.Lock()
b.summary.ItemStats.Add(s)
b.summary.Unlock()
@@ -365,3 +365,9 @@ func (b *Backup) Finish() {
formatDuration(time.Since(b.start)),
)
}
// SetMinUpdatePause sets b.MinUpdatePause. It satisfies the
// ArchiveProgressReporter interface.
func (b *Backup) SetMinUpdatePause(d time.Duration) {
b.MinUpdatePause = d
}