accounting: fix layout of stats - fixes #2910

This fixes several things wrong with the layout of the stats.

Transfers which haven't started are printed in the same format as
those which have so the stats with `--progress` don't show horrible
artifacts.

Checkers and transfers now get a ": checkers" and ": transfers" label
on the end of the stats line.  Transfers will have the transfer stats
when the transfer has started instead of this.

There was a bug in the routine which shortened the file names (it
always produces strings 1 too long).  This is now fixed with a test.

The formatting string was wrong with a fixed width of 45 - this is now
replaces with the value of `--stats-file-name-length`.

This also meant that there were unecessary leading spaces in the file
names.  So the default `--stats-file-name-length` was raised to 45
from 40.
This commit is contained in:
Nick Craig-Wood
2019-01-14 16:12:39 +00:00
parent bd11d3cb62
commit 5990573ccd
5 changed files with 83 additions and 20 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ func NewConfig() *ConfigInfo {
c.BufferSize = SizeSuffix(16 << 20)
c.UserAgent = "rclone/" + Version
c.StreamingUploadCutoff = SizeSuffix(100 * 1024)
c.StatsFileNameLength = 40
c.StatsFileNameLength = 45
c.AskPassword = true
c.TPSLimitBurst = 1
c.MaxTransfer = -1