diff options
author | Hanna Fadida <hanna.fadida@redislabs.com> | 2021-10-17 17:31:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-17 17:31:06 +0300 |
commit | 61bb04415614f4b99002cc6c6a31ef5019881b07 (patch) | |
tree | 5d1cfd2cd8e1ec594fed762795bf6126bd1b91a3 /src/object.c | |
parent | e7864a2b7022a3738a6829cf61a6c3dd5ba62c71 (diff) | |
download | redis-61bb04415614f4b99002cc6c6a31ef5019881b07.tar.gz |
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.
Diffstat (limited to 'src/object.c')
-rw-r--r-- | src/object.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 <key> [SAMPLES <count>]", " Return memory in bytes used by <key> and its value. Nested values are", -" sampled up to <count> times (default: 5).", +" sampled up to <count> times (default: 5, 0 means sample all).", NULL }; addReplyHelp(c, help); |