diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-10 22:22:49 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-10 22:22:49 +0100 |
commit | 55a9946145b172d21c917a6ae68f3676cdd3345b (patch) | |
tree | 1a8a655834eaf2bdade8348a562d4822a108e08f /module/remote/thriftbackend/ThriftTest.py | |
parent | thriftbackend cleanup (diff) | |
download | pyload-55a9946145b172d21c917a6ae68f3676cdd3345b.tar.xz |
thrift + setup fixes
Diffstat (limited to 'module/remote/thriftbackend/ThriftTest.py')
-rw-r--r-- | module/remote/thriftbackend/ThriftTest.py | 22 |
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() |