File-upload: smooth time remaining, bitrate and stabilize user information#30147
File-upload: smooth time remaining, bitrate and stabilize user information#30147susnux merged 7 commits intonextcloud:fix/improved-upload-viewfrom
Conversation
Besides the existing moving average, a smoothing factor is introduced for the time remaining display as well as the bitrate. Furthermore, half of the buffer needs to be filled before the first prediction is displayed to the user. This reduces volatile and jumping durations towards the user and improves usability.
Signed-off-by: Cyrill H. <[email protected]>
CarlSchwan
left a comment
There was a problem hiding this comment.
Very cool feature, I left some code style but I didn't test it yet locally. I will give it a try tomorrow :)
Code Style Co-authored-by: Carl Schwan <[email protected]>
Code Style Co-authored-by: Carl Schwan <[email protected]>
Code Style Co-authored-by: Carl Schwan <[email protected]>
Code Style Co-authored-by: Carl Schwan <[email protected]>
Code Style Co-authored-by: Carl Schwan <[email protected]>
artonge
left a comment
There was a problem hiding this comment.
Also, canceling an upload seems to fail now
| } else { | ||
| smoothRemainingSeconds = 1; | ||
| } else{ | ||
| smoothRemainingSeconds = smoothing * (bufferTotal / bufferSize) + ((1-smoothing) * smoothRemainingSeconds); |
There was a problem hiding this comment.
smoothRemainingSeconds value depends on itself, this leads to NaN when I test it.
There was a problem hiding this comment.
Maybe update the above condition to smoothRemainingSeconds === undefined
There was a problem hiding this comment.
It should check for undefined.
if (smoothRemainingSeconds === undefined){
Same for the bitrate:
if (smoothBitrate === undefined){
I just tested this and the NaN problem is fixed.
There was a problem hiding this comment.
Can you push the change?
@artonge this is unrelated, afaik. |
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
|
Interesting approach to merge it into a different branch in our org :) |
|
The bots do not work on foreign repositories, so I decided to merge this into an internal branch and resubmit the PR. BTW: thank you @Phlogi, nice work :) |


Improving the upload progress bar's "Time remaining".
Tested with a single large file and multiple smaller files.
Besides the existing moving average, a smoothing factor is introduced for the time remaining display as well as the bitrate.
Furthermore, half of the buffer needs to be filled before the first prediction is displayed to the user. This reduces volatile and jumping durations towards the user and improves usability.