[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transfer rate computations for Mnemonic



Garrett,

Actually, it would be better if you put the computation in the
NetworkManager select() (NetworkManager::Run()) loop every time you get a
chunk of data in. That way we don't have to modify all the servant classes
(TCP, File, etc) to do the calculations.  So, you'd have to add something
to the network manager connection structure.  That way, we can also do
things like "total transfer rate", and "per connection transfer rate".
Also, then it's easier to send transfer rate updates every n seconds by
using the timeout in the select() call.  Then, if you are feeling
ambitious, update that for any random network timed event (perhaps
allowing a NetworkManager::RegisterTimedEvent(callback *, time)) -- well,
maybe not, I can't see any use for that.  The Display/UI thread should
provide the interface for the Java* stuff -- not the network manager...
but maybe there is some neat thing we can do with it.

Andrew

On Sat, 7 Jun 1997, Garrett Smith wrote:

> Andrew,
> 	I have started work on calculating speeds on file transfers. Currently
> I have a basic computation in the TCPConnection::ReadBlock() call.  The
> way to get the speed is through the GetSpeed() call from the Stream
> class. 
> 	It seems that only ReadBlock() is used right now, not ReadNonBlock, is
> this going to change, if so should I work on adding speed calculation
> there.
> 	The other question I had was on stall detection. I assume that you
> declare it stalled if no data is received for a certian period of time. 
> My question is is there a standard length of time. Any ideas on
> implementing this?
> 	The actual speed computations give transfer rates slightly higher than
> I would expect but maybe its because I am reading from my local
> machine.  The equasion looks right but you might want to give it a look. 
> 	I also probably need to add some kind of averaging so the speed given
> doesn't depend so much on exactly when the ui got the speed. Right now
> the speed is just for the previous read.
> 	I am very open to comments on the design and location of the code.
> 
> Garrett Smith
> gsmith@univprep.pvt.k12.wa.us
> 
> PS. How do you get the debug function to print? Lets say I wanted all
> the debug messages in TCPConnection::ReadBlock() to be printed. How
> would I do this. I have tried calling mnemonic with the
> -dTCPConnection::ReadBlock flag and the -dTCPConnection flag but nothing
> happens.
>