|
|
@@ -982,8 +982,9 @@ func (f *sendReceiveFolder) renameFile(cur, source, target protocol.FileInfo, db
|
|
|
}
|
|
|
|
|
|
blockStatsMut.Lock()
|
|
|
- blockStats["total"] += len(target.Blocks)
|
|
|
- blockStats["renamed"] += len(target.Blocks)
|
|
|
+ minBlocksPerBlock := target.BlockSize() / protocol.MinBlockSize
|
|
|
+ blockStats["total"] += len(target.Blocks) * minBlocksPerBlock
|
|
|
+ blockStats["renamed"] += len(target.Blocks) * minBlocksPerBlock
|
|
|
blockStatsMut.Unlock()
|
|
|
|
|
|
// The file was renamed, so we have handled both the necessary delete
|
|
|
@@ -1559,15 +1560,16 @@ func (f *sendReceiveFolder) finisherRoutine(in <-chan *sharedPullerState, dbUpda
|
|
|
if err != nil {
|
|
|
f.newPullError(state.file.Name, err)
|
|
|
} else {
|
|
|
+ minBlocksPerBlock := state.file.BlockSize() / protocol.MinBlockSize
|
|
|
blockStatsMut.Lock()
|
|
|
- blockStats["total"] += state.reused + state.copyTotal + state.pullTotal
|
|
|
- blockStats["reused"] += state.reused
|
|
|
- blockStats["pulled"] += state.pullTotal
|
|
|
+ blockStats["total"] += (state.reused + state.copyTotal + state.pullTotal) * minBlocksPerBlock
|
|
|
+ blockStats["reused"] += state.reused * minBlocksPerBlock
|
|
|
+ blockStats["pulled"] += state.pullTotal * minBlocksPerBlock
|
|
|
// copyOriginShifted is counted towards copyOrigin due to progress bar reasons
|
|
|
// for reporting reasons we want to separate these.
|
|
|
- blockStats["copyOrigin"] += state.copyOrigin - state.copyOriginShifted
|
|
|
- blockStats["copyOriginShifted"] += state.copyOriginShifted
|
|
|
- blockStats["copyElsewhere"] += state.copyTotal - state.copyOrigin
|
|
|
+ blockStats["copyOrigin"] += (state.copyOrigin - state.copyOriginShifted) * minBlocksPerBlock
|
|
|
+ blockStats["copyOriginShifted"] += state.copyOriginShifted * minBlocksPerBlock
|
|
|
+ blockStats["copyElsewhere"] += (state.copyTotal - state.copyOrigin) * minBlocksPerBlock
|
|
|
blockStatsMut.Unlock()
|
|
|
}
|
|
|
|