Created
February 4, 2014 03:21
-
-
Save mumumu/8797653 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import redis | |
from optparse import OptionParser | |
from benchmarker import Benchmarker | |
parser = OptionParser() | |
parser.add_option("-n", "--num", dest="num", action="store", | |
help="iterate number", type="int", default=10000) | |
(options, args) = parser.parse_args() | |
r = redis.StrictRedis(host='localhost', port=6379, db=0) | |
with Benchmarker(width=20) as bm: | |
with bm('zrangebyscore'): | |
result = r.zrangebyscore('mykey', 1,1, 0, options.num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment