diff --git a/demos/benchmark/app.py b/demos/benchmark/app.py index edcb6f3..4d7d91d 100644 --- a/demos/benchmark/app.py +++ b/demos/benchmark/app.py @@ -1,3 +1,7 @@ +from __future__ import print_function + +import sys + import tornadoredis import tornado.httpserver import tornado.web @@ -7,6 +11,10 @@ import redis +PY3 = sys.version > '3' +if PY3: + xrange = range + logging.basicConfig(level=logging.DEBUG) log = logging.getLogger('app') @@ -92,12 +100,12 @@ def get(self): # Start the data initialization routine http_server = tornado.httpserver.HTTPServer(application) http_server.listen(8888) - print 'Benchmark is runing at 0.0.0.0:8888\n' \ - 'Quit the benchmark with CONTROL-C\n' \ - 'Use the following paths for benchmarking:\n' \ - ' / - increment benchmark\n' \ - ' /pool - connection pool benchmark\n' \ - ' /mset - MSET benchmark\n' \ - ' /redis-py/ - increment benchmark\n' \ - ' /redis-py/mset - MSET benchmark' + print('Benchmark is runing at 0.0.0.0:8888\n' + 'Quit the benchmark with CONTROL-C\n' + 'Use the following paths for benchmarking:\n' + ' / - increment benchmark\n' + ' /pool - connection pool benchmark\n' + ' /mset - MSET benchmark\n' + ' /redis-py/ - increment benchmark\n' + ' /redis-py/mset - MSET benchmark') tornado.ioloop.IOLoop.instance().start()