From 92ae951ffafff396f748a096946f43639d37a60f Mon Sep 17 00:00:00 2001 From: greatroar <@> Date: Thu, 20 Feb 2020 21:54:31 +0100 Subject: [PATCH] Report timing from restic restore --verify --- cmd/restic/cmd_restore.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/restic/cmd_restore.go b/cmd/restic/cmd_restore.go index cbab2bed4..0ece13e5f 100644 --- a/cmd/restic/cmd_restore.go +++ b/cmd/restic/cmd_restore.go @@ -2,6 +2,7 @@ package main import ( "strings" + "time" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" @@ -202,6 +203,7 @@ func runRestore(opts RestoreOptions, gopts GlobalOptions, args []string) error { if opts.Verify { Verbosef("verifying files in %s\n", opts.Target) var count int + t0 := time.Now() count, err = res.VerifyFiles(ctx, opts.Target) if err != nil { return err @@ -209,7 +211,8 @@ func runRestore(opts RestoreOptions, gopts GlobalOptions, args []string) error { if totalErrors > 0 { return errors.Fatalf("There were %d errors\n", totalErrors) } - Verbosef("finished verifying %d files in %s\n", count, opts.Target) + Verbosef("finished verifying %d files in %s (took %s)\n", count, opts.Target, + time.Since(t0).Round(time.Millisecond)) } return nil