New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too much precision shown for transfer speed #7664
Comments
I think you have chosen the worst case in your screenshot! I agree though, that is too much precision. Here is the reason why Line 70 in 4e07a72
Maybe we should scale down the precision here @albertony - I know this is an area you are interested in - thoughts? |
Hm. I can agree that 3 decimals may be a bit much. But I'm not sure I would want to reduce it too much either, my feeling is we would quickly loose relevant information. Quick look at others, git seem to use 2 decimals: Robocopy on Windows on the other hand is quite detailed... 😄
Was the suggestion to take a bit more drastically different approach to the whole scaling, could you give an example? |
I was wondering whether we should be thinking about significant figures rather than decimals. So if we aimed for 5 Sig figs then we'd get
Which might be more sensible? And also constant width. |
I think so - I like it. Although
This is a big plus. I don't know if there is a magic format string that would give exactly this result, but after some quick experimenting package main
import (
"fmt"
)
func printit(v float64) {
fmt.Printf("%#.5g\n", v)
}
func main() {
printit(111111.1111)
printit(11111.11111)
printit(1111.111111)
printit(111.1111111)
printit(11.11111111)
printit(1.111111111)
printit(.1111111111)
printit(.0111111111)
printit(.0011111111)
printit(.0001111111)
}
Since we do the scaling to units we wouldn't get scientific notation like in the first result (until The last four could happen, but only for low unscaled byte values from speed calculations, like |
If not considering performance, a silly sprintf+parse+sprintf combo for values below zero would give the constant width aspect. Changing the function to: func printit(v float64) {
if v < 1.0 {
x, _ := strconv.ParseFloat(fmt.Sprintf("%#.5g", v), 64)
fmt.Printf("%.4f\n", x)
} else {
fmt.Printf("%#.5g\n", v)
}
} Would change only the last four results, they would fit the width of the rest:
|
This number updates three times per second. There is no value in showing 12345 if the next 0.3 seconds from now it's going to be 15347. And this scenario happens frequently unless you are only transferring large files (eg 50Mb+) over a relatively slow connection (eg 50mb/s). Here are good numbers 1.00k |
It is "binary" units, it would need to be at least 4 significant digits:
|
999.0Ki Those are easy to fix. Nobody cares about the .0 in 999.0Ki. And numbers do not format with an orphan . at end. And 1.000 is too much precision. So a good formatting is 999Ki If somebody really really cares about that extra third digit of precision in some of these things they're going to be misled. This probably means they're doing network performance profiling, and there's already overhead in all of the protocols that are clone uses. Therefore, they need to actually use a network performance monitoring tool to get the data they want. |
For transfers you are right. However this conversion is used for a lot of other things not just fluctuating bandwidth, for example
We could have multiple conversions I suppose, but I'd rather pick one we can use everywhere for consistency. The fixed width ones are attractive because they will look good in |
The associated forum post URL from
https://forum.rclone.org
n/a
What is the problem you are having with rclone?
When performing a transfer (
rclone sync
) too much precision is shown by default.Currently up to 7 digits of precision are shown, which is unnecessary. The maximum should be 2 or maybe 3.
What is your rclone version (output from
rclone version
)Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
macOS 14
Which cloud storage system are you using? (e.g. Google Drive)
n/a
The command you were trying to run (e.g.
rclone copy /tmp remote:tmp
)A log from the command with the
-vv
flag (e.g. output fromrclone -vv copy /tmp remote:tmp
)n/a
The text was updated successfully, but these errors were encountered: