Skip to content

Commit 3758579

Browse files
implement memory_malloc_stats
1 parent 5cd878d commit 3758579

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
@@ -575,6 +575,10 @@ def memory_stats(self):
575575
"Return a dictionary of memory stats"
576576
return self.execute_command('MEMORY STATS')
577577

578+
def memory_malloc_stats(self):
579+
"""Return an internal statistics report from the memory allocator."""
580+
return self.execute_command('MEMORY MALLOC-STATS')
581+
578582
def memory_usage(self, key, samples=None):
579583
"""
580584
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)