Problem
- Order of statistics doesn't align with the starting time of a transfer.
- Unstable output on WebUI
Proposal
Change stringSet
to use linkedHashMap.
Besides, anyone know why the speed on WebUI skyrocket when transferring some small files?
Change stringSet
to use linkedHashMap.
Besides, anyone know why the speed on WebUI skyrocket when transferring some small files?
The stats are sorted by name.
Are you suggesting we sort them by start time instead? Or maybe as well?
I don't think we need to do that, just change the sort if we decide that is what we want to do.
These are being transferred to the WebUI via JSON so all order will be lost there I suspect. I think it will be up to the WebUI to order them correctly.
The webui just shows data rclone sends it so you should be able to see this in rclone too I would have thought.
I would suggest sorting by start time. New transfers at the bottom make more sence to me.
I saw the implementation of statistics. If a transfer is not yet started, progress.get(name)
could be nil
(stringset.go:82) and thus we have no way to the start time.
I didn't try in rclone. I suspect the transfer time of small files are underestimated.
This is because the JSON output is not sorted like the normal statistics output.
I was wrong. *Transfer
contains a startTime so that it could be used. In such case, extending stringSet
into transferMap (map[string]*Transfer)
could be even better.
See: https://github.com/Max-Sum/rclone/tree/sortByStartTime
The changes could:
I looked at your code - looks good!
I think the only actual change is here other than renaming/moving files?
sort.Slice(s, func(i, j int) bool {
return s[i].startedAt.Before(s[j].startedAt)
})
Can you send a PR with two commits in, one doing all the renaming and moving of files (which I think is a great idea!) and the next with the actual change?
Thank you - I think this will be a nice change.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.