Registered Member
|
...just continuing discussion from http://bugs.kde.org/show_bug.cgi?id=113170
|
Registered Member
|
Here's the KT source that will log all needed data for testing.
http://bugs.kde.org/attachment.cgi?id=12844&action=view Example output is:
NOTE: Speed is BYTES/second Samples should be taken at 500msec (update is triggered every 500msec) but due to bad accuracy this might not be just so. After KT finishes dl. just grep the log file for TEST:{torrent_name} and import the data in some spreadsheet application (i.e. oocalc). |
Registered Member
|
For my calculations, it is necessary to include for each sample the current time in seconds since epoch (QDateTime::currentDateTime().toTime_t()).
Also, "bytes left" is useful. This could be also calculated from total size and bytes downloaded, but for total size, the log would need some kind of header... Apart from that, I would log information like leechers/seeders total/connected. It haven't used it yet, but it's thinkable, and the more information the collected logs contain, the better. State changes: If the user stops the download, quits, the tracker is down/can't be reached etc., this would break the log. So it would be good to log three state transitions: - ACTIVATED: the torrent becomes active, i.e. "stalled" or "downloading". - DEACTIVATED: the torrent is not seeding nor stalled nor downloading. This must be logged when there is an error, the user stops the torrent manually, or quits ktorrent - FINISHED: the download finished, and the torrent switches to "seeding". After that, no further logging is needed. This could be logged like 12345678 ACTIVATED 12345800 DEACTIVATED 12349000 FINISHED (the number is the timestamp) Then a script can remove the state changes and adjust the time stamps of the samples accordingly. |
Registered Member
|
Ok. So something like this will do?
STATE is (activated, deactivated, finished or running) |
Registered Member
|
I have it done. Finally, test header turned out to be something like this:
Notice that {PEERS} is total number of seeders and leechers we are connected to. I had to do this since there is no easy way to find out weather peer is seeder or leecher (at least not without complicating the code). Samples are taken every second (it's easier to deal with that 500msec), though actuall updates are happening every 500msec. I just need to test it a bit more before I post the source for testing. |
Moderator
|
|
Registered Member
|
Yeah, that should be fine. Maybe log state changes separately, TorrentControl would need a signal like "stateChanged(oldState, newState)" then which could be connected to the logger. if the state changes, the logger would write torrentname,timestamp,state
Hmm, what about TorrentControl::getSeederInfo(), and TorrentControl::getLeecherInfo()? Don't they work correctly? Where is the info logged to? It would be good to have it in a file like .kde/share/apps/ktorrent/log, that would be the most convenient way. I'd write a simple script then to split it in separated logs for every torrent download. |
Registered Member
|
Here's a part from my log file:
So this should be fine, I think. Yes they do, same as Peer::isSeeder(), but in that case I'd need Peer id which I can get only by iterating through all peers connected. I wanted to avoid those complications since I don't think having the exact number of seeders/leechers would be of the highest importance. If you insist I can do it... It is logged to ~/.kde/share/apps/ktorrent/log |
Registered Member
|
Yeah, should be fine. Is there an easy way to get peers total/peers connected? Or does that also need iterating over all peers? However, if you upload the modified code (maybe a svn diff would do it?), I'll play with it, adjust my scripts, and the logging if I run into problems. |
Registered Member
|
Ok then. I've uploaded the patch file and you can download it here
Hopefully, I'll have my test results tomorrow and I'll place them here. |
Registered Member
|
I put a first script online for extracting the single torrents from the logfile:
http://www-user.rhrk.uni-kl.de/~f_osterf/projekte/estimation/ |
Registered Member
|
I updated the page, including Sample class and estimators. Have to bundle it together at some point and make the hackish script I use for evaluation right now to create a bit more useful output. Any statistics and/or gnuplot experts around? |
Registered Member
|
|
Registered Member
|
Hmm, it shows up here and the file on the server is up-to-date. But you can also try http://www-user.rhrk.uni-kl.de/~f_oster ... ation.html It's the same file, I accidentally copied it twice to the server. |
Registered Member
|
Registered users: bancha, Bing [Bot], Google [Bot], Sogou [Bot]