mirror of https://github.com/aria2/aria2
Documented aria2.getGlobalStat RPC method in man page.
parent
cc7bc0aad3
commit
7aa41d25ac
|
@ -1,6 +1,7 @@
|
||||||
ARIA2C(1)
|
ARIA2C(1)
|
||||||
=========
|
=========
|
||||||
Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
:doctype: manpage
|
||||||
:man source: Aria2
|
:man source: Aria2
|
||||||
:man manual: Aria2 Manual
|
:man manual: Aria2 Manual
|
||||||
:man version: 1.11.2
|
:man version: 1.11.2
|
||||||
|
@ -2785,6 +2786,72 @@ change log file. To stop logging, give empty string("") as a parameter
|
||||||
value. Note that log file is always opened in append mode. This method
|
value. Note that log file is always opened in append mode. This method
|
||||||
returns "OK" for success.
|
returns "OK" for success.
|
||||||
|
|
||||||
|
[[aria2_rpc_aria2_getGlobalStat]]
|
||||||
|
*aria2.getGlobalStat* ()
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Description
|
||||||
|
+++++++++++
|
||||||
|
|
||||||
|
This method returns global statistics such as overall download and
|
||||||
|
upload speed. The response is of type struct and contains following
|
||||||
|
keys. The value type is string.
|
||||||
|
|
||||||
|
downloadSpeed::
|
||||||
|
|
||||||
|
Overall download speed (byte/sec).
|
||||||
|
|
||||||
|
uploadSpeed::
|
||||||
|
|
||||||
|
Overall upload speed(byte/sec).
|
||||||
|
|
||||||
|
numActive::
|
||||||
|
|
||||||
|
The number of active downloads.
|
||||||
|
|
||||||
|
numWaiting::
|
||||||
|
|
||||||
|
The number of waiting downloads.
|
||||||
|
|
||||||
|
numStopped::
|
||||||
|
|
||||||
|
The number of stopped downloads.
|
||||||
|
|
||||||
|
JSON-RPC Example
|
||||||
|
++++++++++++++++
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
>>> import urllib2, json
|
||||||
|
>>> from pprint import pprint
|
||||||
|
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
|
||||||
|
... 'method':'aria2.getGlobalStat'})
|
||||||
|
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
|
||||||
|
>>> pprint(json.loads(c.read()))
|
||||||
|
{u'id': u'qwer',
|
||||||
|
u'jsonrpc': u'2.0',
|
||||||
|
u'result': {u'downloadSpeed': u'21846',
|
||||||
|
u'numActive': u'2',
|
||||||
|
u'numStopped': u'0',
|
||||||
|
u'numWaiting': u'0',
|
||||||
|
u'uploadSpeed': u'0'}}
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
XML-RPC Example
|
||||||
|
+++++++++++++++
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
>>> import xmlrpclib
|
||||||
|
>>> from pprint import pprint
|
||||||
|
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
|
||||||
|
>>> r = s.aria2.getGlobalStat()
|
||||||
|
>>> pprint(r)
|
||||||
|
{'downloadSpeed': '23136',
|
||||||
|
'numActive': '2',
|
||||||
|
'numStopped': '0',
|
||||||
|
'numWaiting': '0',
|
||||||
|
'uploadSpeed': '0'}
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
[[aria2_rpc_aria2_purgeDownloadResult]]
|
[[aria2_rpc_aria2_purgeDownloadResult]]
|
||||||
*aria2.purgeDownloadResult* ()
|
*aria2.purgeDownloadResult* ()
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
Loading…
Reference in New Issue