summaryrefslogtreecommitdiffstats
path: root/module/remote/thriftbackend/ThriftTest.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-10 22:22:49 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-10 22:22:49 +0100
commit55a9946145b172d21c917a6ae68f3676cdd3345b (patch)
tree1a8a655834eaf2bdade8348a562d4822a108e08f /module/remote/thriftbackend/ThriftTest.py
parentthriftbackend cleanup (diff)
downloadpyload-55a9946145b172d21c917a6ae68f3676cdd3345b.tar.xz
thrift + setup fixes
Diffstat (limited to 'module/remote/thriftbackend/ThriftTest.py')
-rw-r--r--module/remote/thriftbackend/ThriftTest.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/module/remote/thriftbackend/ThriftTest.py b/module/remote/thriftbackend/ThriftTest.py
index d73f04ade..9bbb8cbb9 100644
--- a/module/remote/thriftbackend/ThriftTest.py
+++ b/module/remote/thriftbackend/ThriftTest.py
@@ -20,9 +20,12 @@ import xmlrpclib
def bench(f, *args, **kwargs):
s = time()
- ret = [f(*args, **kwargs) for i in range(0,200)]
+ ret = [f(*args, **kwargs) for i in range(0,250)]
e = time()
- print "time", e-s
+ try:
+ print "%s: %f s" % (f._Method__name, e-s)
+ except :
+ print "%s: %f s" % (f.__name__, e-s)
return ret
server_url = "http%s://%s:%s@%s:%s/" % (
@@ -35,6 +38,8 @@ server_url = "http%s://%s:%s@%s:%s/" % (
proxy = xmlrpclib.ServerProxy(server_url, allow_none=True)
bench(proxy.get_server_version)
+bench(proxy.status_server)
+bench(proxy.status_downloads)
bench(proxy.get_queue)
bench(proxy.get_collector)
print
@@ -55,12 +60,23 @@ try:
# Connect!
transport.open()
- print "Login", client.login("User", "password")
+ print "Login", client.login("User", "pyloadweb")
bench(client.getServerVersion)
+ bench(client.statusServer)
+ bench(client.statusDownloads)
bench(client.getQueue)
bench(client.getCollector)
+ print
+ print client.getServerVersion()
+ print client.statusServer()
+ print client.statusDownloads()
+ q = client.getQueue()
+
+ for p in q:
+ print client.getPackageData(p.pid)
+
# Close!
transport.close()