-
-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to access specific values in the alert object #1953
Comments
right, the python binding turns the array into a dictionary mapping the names to the values. i.e. in python you don't have to look up any index up-front |
This should probably be documented in the python binding documentation. if you're up for it, please submit pull request! |
Thanks for the answer. |
yes |
So I tried to use
It worked, but the result looks like incorrent:
I was expecting |
payload refers to the actual content of the torrent. The difference between "bytes" and "payload" is the bittorrent protocol overhead (like, sending requests, heartbeats, haves etc.). In your case it looks like you're downloading, so the majority of those bytes are likely requests and haves. If you have a high churn of peers it may also be bitfields. |
Yes indeed, I am measuring downloading statistics. |
I seem to recall |
Explain retrieving session statistics in python. Based on the discussion here: #1953
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
libtorrent version (or branch):
1.1.3.0
platform/architecture:
Ubuntu 16.04, x64
compiler and compiler version:
gcc (GCC) 5.4.0
Python version:
Python 2.7.12
please describe what symptom you see, what you would expect to see instead and
how to reproduce it.
I am trying to access session statistics and I am only interested in a few of them. It is suggested by the doc that "Always query the metrics first, to find out the index at which the value is stored".
However, the
alert
object returned by callingpost_session_stats()
doesn't support indexing.So here come two questions:
lt.find_metric_idx("NAME_OF_STATS")
?alert.values["NAME_OF_STATS"]
to get the stats? (e.g.alert.values["ses.num_incoming_choke"]
)The text was updated successfully, but these errors were encountered: