ElapsedRowCopyTime returns time since starting to copy chunks of rows
()
| 565 | |
| 566 | // ElapsedRowCopyTime returns time since starting to copy chunks of rows |
| 567 | func (mctx *MigrationContext) ElapsedRowCopyTime() time.Duration { |
| 568 | mctx.throttleMutex.Lock() |
| 569 | defer mctx.throttleMutex.Unlock() |
| 570 | |
| 571 | if mctx.RowCopyStartTime.IsZero() { |
| 572 | // Row copy hasn't started yet |
| 573 | return 0 |
| 574 | } |
| 575 | |
| 576 | if mctx.RowCopyEndTime.IsZero() { |
| 577 | return time.Since(mctx.RowCopyStartTime) |
| 578 | } |
| 579 | return mctx.RowCopyEndTime.Sub(mctx.RowCopyStartTime) |
| 580 | } |
| 581 | |
| 582 | // ElapsedRowCopyTime returns time since starting to copy chunks of rows |
| 583 | func (mctx *MigrationContext) MarkRowCopyEndTime() { |
no outgoing calls
no test coverage detected