MCPcopy
hub / github.com/github/gh-ost / getProgressPercent

Method getProgressPercent

go/logic/migrator.go:1272–1278  ·  view source on GitHub ↗

getProgressPercent returns an estimate of migration progess as a percent.

(rowsEstimate int64)

Source from the content-addressed store, hash-verified

1270
1271// getProgressPercent returns an estimate of migration progess as a percent.
1272func (mgtr *Migrator) getProgressPercent(rowsEstimate int64) (progressPct float64) {
1273 progressPct = 100.0
1274 if rowsEstimate > 0 {
1275 progressPct *= float64(mgtr.migrationContext.GetTotalRowsCopied()) / float64(rowsEstimate)
1276 }
1277 return progressPct
1278}
1279
1280// getMigrationETA returns the estimated duration of the migration
1281func (mgtr *Migrator) getMigrationETA(rowsEstimate int64) (eta string, duration time.Duration) {

Callers 3

getMigrationETAMethod · 0.95
printStatusMethod · 0.95

Calls 1

GetTotalRowsCopiedMethod · 0.80

Tested by 1