forked from TrueCloudLab/rclone
stats: show the amount of data transferred in kb/mb - fixes #1167
This commit is contained in:
parent
41a97e39c8
commit
b4aa920a3d
1 changed files with 7 additions and 4 deletions
|
@ -561,7 +561,7 @@ func (acc *Account) ETA() (eta time.Duration, ok bool) {
|
||||||
// String produces stats for this file
|
// String produces stats for this file
|
||||||
func (acc *Account) String() string {
|
func (acc *Account) String() string {
|
||||||
a, b := acc.Progress()
|
a, b := acc.Progress()
|
||||||
_, cur := acc.Speed()
|
bps, cur := acc.Speed()
|
||||||
eta, etaok := acc.ETA()
|
eta, etaok := acc.ETA()
|
||||||
etas := "-"
|
etas := "-"
|
||||||
if etaok {
|
if etaok {
|
||||||
|
@ -581,13 +581,16 @@ func (acc *Account) String() string {
|
||||||
cur = cur * 8
|
cur = cur * 8
|
||||||
}
|
}
|
||||||
|
|
||||||
done := ""
|
done := fmt.Sprintf("%2s/%s", SizeSuffix(a), SizeSuffix(b))
|
||||||
if b > 0 {
|
if b > 0 {
|
||||||
done = fmt.Sprintf("%2d%% done, ", int(100*float64(a)/float64(b)))
|
done += fmt.Sprintf(" %2d%% done, ", int(100*float64(a)/float64(b)))
|
||||||
|
} else {
|
||||||
|
done += " 0%% done, "
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%45s: %s%s, ETA: %s",
|
return fmt.Sprintf("%45s: %s%s / %s, ETA: %s",
|
||||||
string(name),
|
string(name),
|
||||||
done,
|
done,
|
||||||
|
SizeSuffix(bps).Unit(strings.Title(Config.DataRateUnit)+"/s"),
|
||||||
SizeSuffix(cur).Unit(strings.Title(Config.DataRateUnit)+"/s"),
|
SizeSuffix(cur).Unit(strings.Title(Config.DataRateUnit)+"/s"),
|
||||||
etas,
|
etas,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue