According to the BitTorrent paper
(http://bitconjurer.org/BitTorrent/bittorrentecon.pdf),
the rate should be calculated based on a rolling 20-
seconds average. This patch will save the bandwidth
data in a history array and calculate the rate based on
the samples taken in the last 20-seconds.
A side effect of this patch is that the rate displayed will
top at the maximum number of samples multiplied by the
slice size divided by 20.
Also, the history array waists memory since only the last
20 second samples are relevant. One improvement would
be to dinamically allocate the history data, e.g. using a
linked list.
rate.patch