Revision: 339
Author: bslatkin
Date: Sun Feb 28 23:08:12 2010
Log: hub: add flush button for stats/memcache
http://code.google.com/p/pubsubhubbub/source/detail?r=339
Modified:
/trunk/hub/all_stats.html
/trunk/hub/main.py
=======================================
--- /trunk/hub/all_stats.html Fri Feb 26 11:54:31 2010
+++ /trunk/hub/all_stats.html Sun Feb 28 23:08:12 2010
@@ -6,6 +6,10 @@
</head>
<body>
+<form action="/stats" method="post" accept-charset="utf-8">
+ <input type="submit" name="action" value="Flush" id="">
+</form>
+
<h1>Table of contents</h1>
<ul>
{% for config in all_configs %}
=======================================
--- /trunk/hub/main.py Fri Feb 26 11:54:31 2010
+++ /trunk/hub/main.py Sun Feb 28 23:08:12 2010
@@ -3000,6 +3000,12 @@
class StatsHandler(webapp.RequestHandler):
"""Handler that serves DoS statistics information."""
+ def post(self):
+ if self.request.get('action').lower() == 'flush':
+ logging.critical('Flushing memcache!')
+ memcache.flush_all()
+ self.redirect('/stats')
+
def get(self):
context = {
'fetch_url_error': [