Hi,
I was just missing having an indication of how long the sync would take to finish - I get GiB remaining and MiB/s transferred, but I’d like an estimate of how long time remains, so I don’t have to do the calculation myself.
There is an open issue on this: #3698.
There hasn’t been any activity on it for a while, so I took a stab at it.
I could not make the code from the repo work (lots of fields in the GUI showed up with {}'s), so I worked on the version packaged in Debian unstable.
I know there probably should be a lot more factors incorporated in making a good estimate, but here is my working first version, which just takes the bytes remaining to be synced and divides by the current maximum transfer rate:
Index: syncthing-0.14.52+ds1/gui/default/index.html
===================================================================
--- syncthing-0.14.52+ds1.orig/gui/default/index.html
+++ syncthing-0.14.52+ds1/gui/default/index.html
@@ -634,7 +634,7 @@
<span ng-switch="deviceStatus(deviceCfg)" class="pull-right text-{{deviceClass(deviceCfg)}}">
<span ng-switch-when="insync"><span class="hidden-xs" translate>Up to Date</span><span class="visible-xs">◼</span></span>
<span ng-switch-when="syncing">
- <span class="hidden-xs" translate>Syncing</span> ({{completion[deviceCfg.deviceID]._total | percent}}, {{completion[deviceCfg.deviceID]._needBytes | binary}}B)
+ <span class="hidden-xs" translate>Syncing</span> ({{completion[deviceCfg.deviceID]._total | percent}}, {{completion[deviceCfg.deviceID]._needBytes | binary}}B, {{syncETA(deviceCfg.deviceID) | duration}})
</span>
<span ng-switch-when="paused"><span class="hidden-xs" translate>Paused</span><span class="visible-xs">◼</span></span>
<span ng-switch-when="disconnected"><span class="hidden-xs" translate>Disconnected</span><span class="visible-xs">◼</span></span>
Index: syncthing-0.14.52+ds1/gui/default/syncthing/core/syncthingController.js
===================================================================
--- syncthing-0.14.52+ds1.orig/gui/default/syncthing/core/syncthingController.js
+++ syncthing-0.14.52+ds1/gui/default/syncthing/core/syncthingController.js
@@ -813,6 +813,16 @@ angular.module('syncthing.core')
return bytes;
};
+ $scope.syncETA = function (deviceID) {
+ // Remaining sync bytes divided by max of Download rate and Upload rate ~ ETA:
+ var bytes = $scope.completion[deviceID]._needBytes;
+ var rate = Math.max($scope.connections[deviceID].inbps, $scope.connections[deviceID].outbps);
+ if (rate == 0) {
+ return "";
+ }
+ return Math.floor(bytes / rate);
+ };
+
$scope.scanPercentage = function (folder) {
if (!$scope.scanProgress[folder]) {
return undefined;
I hope it can be useful to someone, or perhaps a starting point.
The patch against master can be pulled from https://koldfront.dk/git/syncthing/