From 3758579b42c4cc7546343dcf348891e933cb922f Mon Sep 17 00:00:00 2001 From: AvitalFineRedis Date: Thu, 14 Oct 2021 15:21:19 +0200 Subject: implement memory_malloc_stats --- redis/commands.py | 4 ++++ tests/test_commands.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/redis/commands.py b/redis/commands.py index eb7cea5..bbd422f 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -575,6 +575,10 @@ class Commands: "Return a dictionary of memory stats" return self.execute_command('MEMORY STATS') + def memory_malloc_stats(self): + """Return an internal statistics report from the memory allocator.""" + return self.execute_command('MEMORY MALLOC-STATS') + def memory_usage(self, key, samples=None): """ Return the total memory usage for key, its value and associated diff --git a/tests/test_commands.py b/tests/test_commands.py index 2be8923..21f2597 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -3454,6 +3454,10 @@ class TestRedisCommands: .execute()) assert resp == [0, None, 255] + @skip_if_server_version_lt('4.0.0') + def test_memory_malloc_stats(self, r): + assert r.memory_malloc_stats() + @skip_if_server_version_lt('4.0.0') def test_memory_stats(self, r): # put a key into the current db to make sure that "db." -- cgit v1.2.1