Meter provides a progress bar type output for the TransferQueue. It is given an estimated file count and size up front and tracks the number of files and bytes transferred as well as the number of files and bytes that get skipped because the transfer is unnecessary.
| 21 | // files and bytes transferred as well as the number of files and bytes that |
| 22 | // get skipped because the transfer is unnecessary. |
| 23 | type Meter struct { |
| 24 | finishedFiles int64 // int64s must come first for struct alignment |
| 25 | transferringFiles int64 |
| 26 | estimatedBytes int64 |
| 27 | lastBytes int64 |
| 28 | currentBytes int64 |
| 29 | sampleCount uint64 |
| 30 | avgBytes float64 |
| 31 | lastAvg time.Time |
| 32 | estimatedFiles int32 |
| 33 | paused uint32 |
| 34 | fileIndex map[string]int64 // Maps a file name to its transfer number |
| 35 | fileIndexMutex *sync.Mutex |
| 36 | updates chan *tasklog.Update |
| 37 | cfg *config.Configuration |
| 38 | |
| 39 | DryRun bool |
| 40 | Logger *tools.SyncWriter |
| 41 | Direction Direction |
| 42 | } |
| 43 | |
| 44 | type env interface { |
| 45 | Get(key string) (val string, ok bool) |
nothing calls this directly
no outgoing calls
no test coverage detected