diff options
-rw-r--r-- | redis/client.py | 4 | ||||
-rw-r--r-- | tests/server_commands.py | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py index 352e98a..40493d0 100644 --- a/redis/client.py +++ b/redis/client.py @@ -426,6 +426,10 @@ class StrictRedis(object): "Set config item ``name`` with ``value``" return self.execute_command('CONFIG', 'SET', name, value, parse='SET') + def config_resetstat(self): + "Reset runtime statistics" + return self.execute_command('CONFIG', 'RESETSTAT', parse='SET') + def dbsize(self): "Returns the number of keys in the current database" return self.execute_command('DBSIZE') diff --git a/tests/server_commands.py b/tests/server_commands.py index 1ae8f80..7dcc221 100644 --- a/tests/server_commands.py +++ b/tests/server_commands.py @@ -123,6 +123,12 @@ class ServerCommandsTestCase(unittest.TestCase): self.assert_(self.client.config_set('dbfilename', rdbname)) self.assertEquals(self.client.config_get()['dbfilename'], rdbname) + def test_config_resetstat(self): + self.client.ping() + self.assert_(int(self.client.info()['total_commands_processed']) > 1) + self.client.config_resetstat() + self.assertEquals(int(self.client.info()['total_commands_processed']), 1) + def test_debug_object(self): self.client['a'] = 'foo' debug_info = self.client.debug_object('a') |