Skip to content

Instantly share code, notes, and snippets.

@charsyam
Created August 26, 2013 15:44
Show Gist options
  • Save charsyam/6342905 to your computer and use it in GitHub Desktop.
Save charsyam/6342905 to your computer and use it in GitHub Desktop.
redis-stat.py
import redis
import time
r = redis.StrictRedis('127.0.0.1', 6379)
last_total = 0
while(True):
ret = r.info()
if (last_total > 0):
print "command: ", int(ret["total_commands_processed"]) - last_total
print "clients: ", ret["connected_clients"]
print "memory : ", ret["used_memory_human"]
print "role : ", ret["role"]
last_total = int(ret["total_commands_processed"])
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment