This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Moving average

Tags: None
(comma "," separated)
imported-Elez
Registered Member
Posts
19
Karma
0

Moving average

Mon Aug 21, 2006 8:11 am
Hello,
Now with version 2.0 of KTorrent, I'm making another attempt to use it and I see there are improvements, but there are problems as well.
Right now I want to make a suggestion on how to fix one of those problems.

The download/upload speed indicated by KTorrent are changing too quickly and too drastically for people to understand what is the speed. (For instance, one second it shows I'm downloading at 20KB/s and just one short second after, it would show I'm downloading at 7KB/s)

I suggest using a moving average to solve this problem, meaning that the speed that is shown on KTorrent would be the average speed of the last 3 samples or so, or the average speed of the last 3 seconds. something along those lines.

Hope I've been helpful,
Elez
George
Moderator
Posts
5421
Karma
1

Re: Moving average

Mon Aug 21, 2006 4:08 pm
elez wrote:Hello,
Now with version 2.0 of KTorrent, I'm making another attempt to use it and I see there are improvements, but there are problems as well.
Right now I want to make a suggestion on how to fix one of those problems.

The download/upload speed indicated by KTorrent are changing too quickly and too drastically for people to understand what is the speed. (For instance, one second it shows I'm downloading at 20KB/s and just one short second after, it would show I'm downloading at 7KB/s)

I suggest using a moving average to solve this problem, meaning that the speed that is shown on KTorrent would be the average speed of the last 3 samples or so, or the average speed of the last 3 seconds. something along those lines.

Hope I've been helpful,
Elez


The speed displayed is the average speed over the last 2 seconds.
imported-Elez
Registered Member
Posts
19
Karma
0

Re: Moving average

Mon Aug 21, 2006 5:08 pm
George wrote:The speed displayed is the average speed over the last 2 seconds.


ok so increasing the number to maybe like 5 seconds would smooth all the jumps even further.
George
Moderator
Posts
5421
Karma
1

Re: Moving average

Tue Aug 22, 2006 4:17 pm
elez wrote:
George wrote:The speed displayed is the average speed over the last 2 seconds.


ok so increasing the number to maybe like 5 seconds would smooth all the jumps even further.


OK, but why ?
imported-Elez
Registered Member
Posts
19
Karma
0

Re: Moving average

Tue Aug 22, 2006 9:12 pm
George wrote:OK, but why ?


Because when you take larger periods of time, you're less exposed to outliers (really big or really small numbers that ruin the 'average' statistic).

Look at the math of it. When you average a group of numbers, you divide their sum by the amount of numbers you have (or in this case, you divide the throughput by time) so the greater the amount of numbers you have (or greater the time is) the more "smooth" the transition would be from seconds to second. (don't forget that each "new" second includes 4 "old" seconds that keep the result rather steady from the one shown a second ago)

To put it in professional terms, you decrease the sensitivity to changes (which means we'll be able to understand what the speed actually is because the indicator won't be hyper sensitive to little changes)

This will all be caused by having the "large denominator" (a lot of time to divide by)

This is pretty easy to prove mathematically but I can't use integrals and derivatives here.. :lol:
George
Moderator
Posts
5421
Karma
1

Wed Aug 23, 2006 5:15 pm
I understand the math but in cases where the speed has a tendency to drop to 0 pretty often, we would be reporting that you are downloading at X KB/s though the actual speed is 0. The larger the interval is, the more this will happen.
imported-Elez
Registered Member
Posts
19
Karma
0

Wed Aug 23, 2006 5:24 pm
George wrote:I understand the math but in cases where the speed has a tendency to drop to 0 pretty often, we would be reporting that you are downloading at X KB/s though the actual speed is 0. The larger the interval is, the more this will happen.


Yes, but if the speed is 0 for one second, I'd rather see it averaged with the speed I had a few seconds before and a few seconds after.
If the speed is 0 for a long time then I'd rather see the speedometer gradually declining towards 0. This is the price to pay for stability.

Averaging a short period of time means the speedometer jumps far distances.
Averaging a very long period of time means you get the wrong speed displayed on the speedometer.

Averaging a moderate period of time (speaking from experience, this is the 5 second area) means you get a good balance between getting the correct speed and not jumping too much.

a picture is worth a thousand words. I'm sure you'll be pleased at what you see if you choose to change it.

:)
George
Moderator
Posts
5421
Karma
1

Thu Aug 24, 2006 5:42 pm
Maybe we would get less complaints that the speed is less jumpy ... allthough nothing has actually changed.
imported-Elez
Registered Member
Posts
19
Karma
0

Thu Aug 24, 2006 6:19 pm
George wrote:Maybe we would get less complaints that the speed is less jumpy ... allthough nothing has actually changed.


Sorry. I didn't quite get what you mean here :roll:
Can you rephrase?
imported4-Ivan
Registered Member
Posts
819
Karma
0

Fri Aug 25, 2006 12:14 pm
@George: I think you're right. Lots of people are complaining and this would solve that problem.

Sorry. I didn't quite get what you mean here Rolling Eyes
Can you rephrase?


Some people are complaining that KT up/down speeds are too jumpy (zero, than jumps to 200, than falls to 30 etc...). This would surely help the speed being more/less steady, at least in GUI.
imported-Elez
Registered Member
Posts
19
Karma
0

Fri Aug 25, 2006 5:01 pm
Yey! a supporter!

George, I saw some nice feature implemented somewhere (I forgot which application) that the user could choose how many seconds to average, that way everybody gets what they want :wink:
stoeptegel
Registered Member
Posts
1075
Karma
0

Sat Aug 26, 2006 10:24 am
I think i have to go with George on this one, it would misleading the facts. I think it's better to get it more stable in real world in the future, if possible. That would be more usefull in my view than obscuring.
imported-Elez
Registered Member
Posts
19
Karma
0

Sat Aug 26, 2006 11:46 am
stoeptegel wrote:I think i have to go with George on this one, it would misleading the facts. I think it's better to get it more stable in real world in the future, if possible. That would be more usefull in my view than obscuring.


What good is the information you get if it's only relevant to this particular second. I can't seriously estimate when the file's gonna be done if I get 120KB/s for a split second and a 30KB/s for another split second.

What my arguement is, is that the information that's currently provided to me by KTorrent is near useless because I can't extrapolate anything from it.

Read my previous post and see what I suggest to make EVERYBODY happy.
imported4-Ivan
Registered Member
Posts
819
Karma
0

Sat Aug 26, 2006 1:02 pm
I think it's better to get it more stable in real world in the future, if possible. That would be more usefull in my view than obscuring.

I'm not 100% sure, but jumpy speeds are pretty common thing for almost all clients but they 'polish' it the way elez described (or maybe some similar algorithm) so it looks better. Don't get me wrong - offcourse I'm in favor of improving speed jumpiness...
imported-Elez
Registered Member
Posts
19
Karma
0

Sat Aug 26, 2006 1:48 pm
You're correct, Ivan.
My personal hunch is that with KTorrent, the cause of this instability is 10% REAL instability and 90% "GUI" instability.

It's just that the nature of the beast (the internet) is that speed is no where neer constant. We just NEED to create an illusion of stability so that us humans will understand what's going on.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft