getProgressPercent returns an estimate of migration progess as a percent.
(rowsEstimate int64)
| 1270 | |
| 1271 | // getProgressPercent returns an estimate of migration progess as a percent. |
| 1272 | func (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 |
| 1281 | func (mgtr *Migrator) getMigrationETA(rowsEstimate int64) (eta string, duration time.Duration) { |