@@ -11,6 +11,7 @@ import (
" os"
" os/exec"
" path/filepath"
+ " sync/atomic"
" github.com/github/gh-ost/go/base"
" github.com/outbrain/golib/log"
@@ -53,6 +54,11 @@ func (this *HooksExecutor) applyEnvironmentVairables(extraVariables ...string) [
env = append (env, fmt.Sprintf (" GH_OST_OLD_TABLE_NAME=%s " , this.migrationContext .GetOldTableName ()))
env = append (env, fmt.Sprintf (" GH_OST_DDL=%s " , this.migrationContext .AlterStatement ))
env = append (env, fmt.Sprintf (" GH_OST_ELAPSED_SECONDS=%f " , this.migrationContext .ElapsedTime ().Seconds ()))
+ env = append (env, fmt.Sprintf (" GH_OST_ELAPSED_COPY_SECONDS=%f " , this.migrationContext .ElapsedRowCopyTime ().Seconds ()))
+ estimatedRows := atomic.LoadInt64 (&this.migrationContext .RowsEstimate ) + atomic.LoadInt64 (&this.migrationContext .RowsDeltaEstimate )
+ env = append (env, fmt.Sprintf (" GH_OST_ESTIMATED_ROWS=%d " , estimatedRows))
+ totalRowsCopied := this.migrationContext .GetTotalRowsCopied ()
+ env = append (env, fmt.Sprintf (" GH_OST_COPIED_ROWS=%d " , totalRowsCopied))
env = append (env, fmt.Sprintf (" GH_OST_MIGRATED_HOST=%s " , this.migrationContext .ApplierConnectionConfig .ImpliedKey .Hostname ))
env = append (env, fmt.Sprintf (" GH_OST_INSPECTED_HOST=%s " , this.migrationContext .InspectorConnectionConfig .ImpliedKey .Hostname ))
env = append (env, fmt.Sprintf (" GH_OST_EXECUTING_HOST=%s " , this.migrationContext .Hostname ))
0 comments on commit
a58e803