Jelmer Vernooij wrote:
> Public bug reported:
>
>
> affects bzr
>
> The transport speed indicator fluctuates a lot at the moment; it
> would be nice if it could use historic data a little bit to be
> "smoother"; perhaps just showing the average of the last X speeds?
Right now it does a 0.2s average. I found that 0.5s worked well for what
I expected. (My guess is that 0.2 is short enough that we get some
initial small-bytes read and processed, and then a lot of lag before we
get the next big-bytes processed.)
Any further than that, and I would use a first-order filter (rate =
old_rate * X + new_rate * (1-X))
So the quick fix is to just change the "0.2s" to "0.5s" and see what you
think:
=== modified file 'bzrlib/ui/text.py'
- --- bzrlib/ui/text.py 2009-01-21 05:49:18 +0000
+++ bzrlib/ui/text.py 2009-02-12 18:19:37 +0000
@@ -219,7 +219,7 @@
now = time.time()
if self._transport_update_time is None: self._transport_update_time = now
- - elif now >= (self._transport_update_time + 0.2):
+ elif now >= (self._transport_update_time + 0.5):
# guard against clock stepping backwards, and don't update too
# often
rate = self._bytes_since_update / (now -
self._transport_update_time)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jelmer Vernooij wrote:
> Public bug reported:
>
>
> affects bzr
>
> The transport speed indicator fluctuates a lot at the moment; it
> would be nice if it could use historic data a little bit to be
> "smoother"; perhaps just showing the average of the last X speeds?
Right now it does a 0.2s average. I found that 0.5s worked well for what
I expected. (My guess is that 0.2 is short enough that we get some
initial small-bytes read and processed, and then a lot of lag before we
get the next big-bytes processed.)
Any further than that, and I would use a first-order filter (rate =
old_rate * X + new_rate * (1-X))
So the quick fix is to just change the "0.2s" to "0.5s" and see what you
think:
=== modified file 'bzrlib/ui/text.py' _update_ time is None:
self. _transport_ update_ time = now transport_ update_ time + 0.2): transport_ update_ time + 0.5): since_update / (now - _update_ time)
- --- bzrlib/ui/text.py 2009-01-21 05:49:18 +0000
+++ bzrlib/ui/text.py 2009-02-12 18:19:37 +0000
@@ -219,7 +219,7 @@
now = time.time()
if self._transport
- - elif now >= (self._
+ elif now >= (self._
# guard against clock stepping backwards, and don't update too
# often
rate = self._bytes_
self._transport
John
=:->
-----BEGIN PGP SIGNATURE----- enigmail. mozdev. org
UaFAACgkQJdeBCY SNAAMMQwCfcdMSz DWUt4e7+ yrxbMZPG5Ui +/77LbhpEN1liuu kE
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkm
BOoAoJt3fti7weL
=xDbH
-----END PGP SIGNATURE-----