Skip to content

Commit eeac252

Browse files
Merge pull request #1613 from AvitalFineRedis/MEMORY-MALLOC-STATS
Support MEMORY MALLOC-STATS
2 parents 0a55859 + 3758579 commit eeac252

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

redis/commands.py

+4
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ def memory_stats(self):
594594
"""Return a dictionary of memory stats"""
595595
return self.execute_command('MEMORY STATS')
596596

597+
def memory_malloc_stats(self):
598+
"""Return an internal statistics report from the memory allocator."""
599+
return self.execute_command('MEMORY MALLOC-STATS')
600+
597601
def memory_usage(self, key, samples=None):
598602
"""
599603
Return the total memory usage for key, its value and associated

tests/test_commands.py

+4
Original file line numberDiff line numberDiff line change
@@ -3454,6 +3454,10 @@ def test_bitfield_operations(self, r):
34543454
.execute())
34553455
assert resp == [0, None, 255]
34563456

3457+
@skip_if_server_version_lt('4.0.0')
3458+
def test_memory_malloc_stats(self, r):
3459+
assert r.memory_malloc_stats()
3460+
34573461
@skip_if_server_version_lt('4.0.0')
34583462
def test_memory_stats(self, r):
34593463
# put a key into the current db to make sure that "db.<current-db>"

0 commit comments

Comments
 (0)