Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #86 from yukirin/py3_benchmark
Python3 compatibility
  • Loading branch information
leporo committed Sep 5, 2015
2 parents 0f9049e + a0720a3 commit 69e81b2
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions demos/benchmark/app.py
@@ -1,3 +1,7 @@
from __future__ import print_function

import sys

import tornadoredis
import tornado.httpserver
import tornado.web
Expand All @@ -7,6 +11,10 @@

import redis

PY3 = sys.version > '3'
if PY3:
xrange = range

logging.basicConfig(level=logging.DEBUG)

log = logging.getLogger('app')
Expand Down Expand Up @@ -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()

0 comments on commit 69e81b2

Please sign in to comment.