diff --git a/pkg/restore/client.go b/pkg/restore/client.go index dd1258293..9568674c2 100644 --- a/pkg/restore/client.go +++ b/pkg/restore/client.go @@ -814,6 +814,7 @@ func (rc *Client) GoValidateChecksum( } elapsed := time.Since(start) summary.CollectDuration("restore checksum", elapsed) + summary.CollectSuccessUnit("table checksum", 1, elapsed) outCh <- struct{}{} close(outCh) }() diff --git a/pkg/restore/import.go b/pkg/restore/import.go index 27d63e3d1..d7c92476c 100644 --- a/pkg/restore/import.go +++ b/pkg/restore/import.go @@ -326,9 +326,9 @@ func (importer *FileImporter) Import( zap.Error(errIngest)) return errIngest } - summary.CollectSuccessUnit(summary.TotalKV, 1, file.TotalKvs) - summary.CollectSuccessUnit(summary.TotalBytes, 1, file.TotalBytes) } + summary.CollectSuccessUnit(summary.TotalKV, 1, file.TotalKvs) + summary.CollectSuccessUnit(summary.TotalBytes, 1, file.TotalBytes) return nil }, newImportSSTBackoffer()) return err diff --git a/pkg/summary/collector.go b/pkg/summary/collector.go index 903977a4d..d3a6b9bc4 100644 --- a/pkg/summary/collector.go +++ b/pkg/summary/collector.go @@ -77,6 +77,7 @@ type logCollector struct { ints map[string]int uints map[string]uint64 successStatus bool + startTime time.Time log logFunc } @@ -92,6 +93,7 @@ func newLogCollector(log logFunc) LogCollector { ints: make(map[string]int), uints: make(map[string]uint64), log: log, + startTime: time.Now(), } } @@ -189,7 +191,8 @@ func (tc *logCollector) Summary(name string) { for _, cost := range tc.successCosts { totalCost += cost } - msg += fmt.Sprintf(", total take(s): %.2f", totalCost.Seconds()) + msg += fmt.Sprintf(", total take(%s time): %s", name, totalCost) + msg += fmt.Sprintf(", total take(real time): %s", time.Since(tc.startTime)) for name, data := range tc.successData { if name == TotalBytes { fData := float64(data) / 1024 / 1024