From 61bb04415614f4b99002cc6c6a31ef5019881b07 Mon Sep 17 00:00:00 2001 From: Hanna Fadida Date: Sun, 17 Oct 2021 17:31:06 +0300 Subject: Modify mem_usage2 module callback to enable to take sample_size argument (#9612) This is useful for approximating size computation of complex module types. Note that the mem_usage2 callback is new and has not been released yet, which is why we can modify it. --- src/object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/object.c') diff --git a/src/object.c b/src/object.c index edbd56acb..4c62df3f0 100644 --- a/src/object.c +++ b/src/object.c @@ -1127,7 +1127,7 @@ size_t objectComputeSize(robj *key, robj *o, size_t sample_size, int dbid) { raxStop(&ri); } } else if (o->type == OBJ_MODULE) { - asize = moduleGetMemUsage(key, o, dbid); + asize = moduleGetMemUsage(key, o, sample_size, dbid); } else { serverPanic("Unknown object type"); } @@ -1487,7 +1487,7 @@ void memoryCommand(client *c) { " Return information about the memory usage of the server.", "USAGE [SAMPLES ]", " Return memory in bytes used by and its value. Nested values are", -" sampled up to times (default: 5).", +" sampled up to times (default: 5, 0 means sample all).", NULL }; addReplyHelp(c, help); -- cgit v1.2.1