February 14, 2008
My first Django snippet: Another Memcache status view
Hooray! I posted by first Django snippet today. It’s a status view for your memcache server(s).
I had originally used this snippet, but the regex and socket thing never quite sat right with me.
Turns out that django.core.cache has a _cache object with a nice get_status() function. It returns a list of tuples — one for each server in your CACHE_BACKEND setting — the first item of each tuple is the server name/IP and port, the second item of the tuple is a dictionary with all the relevant stats you could need.
Filed under: Django,Python,Technology
Next: Quote of the day: NITF
Previous: Yelp.com missing the boat on RSS
Related
- Django cache keys: making them safer
- Need help fixing WordPre.cio.us
- django-baseboard updated to 0.3