@@ -895,6 +895,8 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
895
895
} else {
896
896
progressPct = 100.0 * float64 (totalRowsCopied ) / float64 (rowsEstimate )
897
897
}
898
+ // we take the opportunity to update migration context with progressPct
899
+ atomic .StoreUint64 (& this .migrationContext .CurrentProgress , math .Float64bits (progressPct ))
898
900
// Before status, let's see if we should print a nice reminder for what exactly we're doing here.
899
901
shouldPrintMigrationStatusHint := (elapsedSeconds % 600 == 0 )
900
902
if rule == ForcePrintStatusAndHintRule {
@@ -911,7 +913,7 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
911
913
eta := "N/A"
912
914
if progressPct >= 100.0 {
913
915
eta = "due"
914
- } else if progressPct >= 1.0 {
916
+ } else if progressPct >= 0.1 {
915
917
elapsedRowCopySeconds := this .migrationContext .ElapsedRowCopyTime ().Seconds ()
916
918
totalExpectedSeconds := elapsedRowCopySeconds * float64 (rowsEstimate ) / float64 (totalRowsCopied )
917
919
etaSeconds = totalExpectedSeconds - elapsedRowCopySeconds
@@ -958,12 +960,13 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
958
960
959
961
currentBinlogCoordinates := * this .eventsStreamer .GetCurrentBinlogCoordinates ()
960
962
961
- status := fmt .Sprintf ("Copy: %d/%d %.1f%%; Applied: %d; Backlog: %d/%d; Time: %+v(total), %+v(copy); streamer: %+v; State: %s; ETA: %s" ,
963
+ status := fmt .Sprintf ("Copy: %d/%d %.1f%%; Applied: %d; Backlog: %d/%d; Time: %+v(total), %+v(copy); streamer: %+v; Lag: %+v, State: %s; ETA: %s" ,
962
964
totalRowsCopied , rowsEstimate , progressPct ,
963
965
atomic .LoadInt64 (& this .migrationContext .TotalDMLEventsApplied ),
964
966
len (this .applyEventsQueue ), cap (this .applyEventsQueue ),
965
967
base .PrettifyDurationOutput (elapsedTime ), base .PrettifyDurationOutput (this .migrationContext .ElapsedRowCopyTime ()),
966
968
currentBinlogCoordinates ,
969
+ this .migrationContext .GetCurrentLagDuration ().Seconds (),
967
970
state ,
968
971
eta ,
969
972
)
0 commit comments