mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 21:07:53 +00:00
rename vars to more sensible names
This commit is contained in:
parent
bd0d68b2fd
commit
5dd4b0e048
1 changed files with 5 additions and 5 deletions
10
util.go
10
util.go
|
|
@ -348,9 +348,9 @@ func roaringFragmentHasData(path string, index, field, view string, shard uint64
|
|||
// GetLoopProgress returns the estimated remaining time to iterate through some items
|
||||
// as well as the loop completion percentage with the following parameters:
|
||||
// the start time, the current time, the iteration, and the number of items
|
||||
func GetLoopProgress(start time.Time, now time.Time, i uint, total uint) (time.Duration, float64) {
|
||||
msgsLeft := total - (i + 1)
|
||||
avgMsgTime := float64(now.Sub(start)) / float64(i+1)
|
||||
pctDone := (float64(i+1) / float64(total)) * 100
|
||||
return time.Duration(avgMsgTime * float64(msgsLeft)), pctDone
|
||||
func GetLoopProgress(start time.Time, now time.Time, iteration uint, total uint) (remaining time.Duration, pctDone float64) {
|
||||
itemsLeft := total - (iteration + 1)
|
||||
avgItemTime := float64(now.Sub(start)) / float64(iteration+1)
|
||||
pctDone = (float64(iteration+1) / float64(total)) * 100
|
||||
return time.Duration(avgItemTime * float64(itemsLeft)), pctDone
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue