Get statistics

Version 2 (olivier dufour, 04/27/2009 12:37 PM)

1 1
h1. Get statistics
2 1
3 2 olivier dufour
h2. Global
4 2 olivier dufour
5 2 olivier dufour
ClientEngine.TotalDownloadSpeed
6 2 olivier dufour
ClientEngine.TotalUploadSpeed
7 2 olivier dufour
8 1
h2. Torrent
9 1
10 2 olivier dufour
To get statistics of a torrrent you use  the ConnectionMonitor object.
11 1
It is available with torrentManager.Monitor
12 1
Here is list of what you can get:
13 1
14 1
* DataBytesDownloaded
15 1
* DataBytesUploaded
16 1
* DownloadSpeed
17 1
* ProtocolBytesDownloaded
18 1
* ProtocolBytesUploaded
19 1
* UploadSpeed
20 1
21 1
h2. Peer
22 2 olivier dufour
To have global information about peers:
23 2 olivier dufour
TorrentManager.Peers.Seeds
24 2 olivier dufour
TorrentManager.Peers.Leechs
25 2 olivier dufour
TorrentManager.Peers.Available
26 1
27 2 olivier dufour
You can get detail about each peer in TorrentManager.GetPeers() or from a peerId get in an event.
28 2 olivier dufour
To get statistics of this particular peer you use the ConnectionMonitor object (same than torrent).
29 1
It is available with PeerId.Monitor
30 1
31 2 olivier dufour
And you have few things directely in the peerId object :
32 2 olivier dufour
* AmChoking
33 2 olivier dufour
* AmInterested
34 2 olivier dufour
* BitField
35 2 olivier dufour
* ClientApp
36 2 olivier dufour
* Encryptor
37 2 olivier dufour
* HashFails
38 2 olivier dufour
* IsChoking
39 2 olivier dufour
* IsConnected
40 2 olivier dufour
* IsInterested
41 2 olivier dufour
* IsSeeder
42 2 olivier dufour
* IsRequestingPiecesCount
43 2 olivier dufour
* PeerID
44 2 olivier dufour
* PiecesSent
45 2 olivier dufour
* PiecesReceived
46 2 olivier dufour
* SupportsFastPeer
47 2 olivier dufour
* SupportsLTMessages
48 2 olivier dufour
* Uri