summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
authormeir@redislabs.com <meir@redislabs.com>2021-10-07 14:41:26 +0300
committermeir <meir@redis.com>2021-12-02 19:35:52 +0200
commitcbd463175f8b52d594fd4e6b953fa58a5db053c3 (patch)
tree2b2e4080b6b4d399eaa3053928f0193f5ddbb360 /src/object.c
parentf21dc38a6ed3851a5e6501199e803ff0b93795cf (diff)
downloadredis-cbd463175f8b52d594fd4e6b953fa58a5db053c3.tar.gz
Redis Functions - Added redis function unit and Lua engine
Redis function unit is located inside functions.c and contains Redis Function implementation: 1. FUNCTION commands: * FUNCTION CREATE * FCALL * FCALL_RO * FUNCTION DELETE * FUNCTION KILL * FUNCTION INFO 2. Register engine In addition, this commit introduce the first engine that uses the Redis Function capabilities, the Lua engine.
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/object.c b/src/object.c
index dab0648a8..7a5563ccb 100644
--- a/src/object.c
+++ b/src/object.c
@@ -29,6 +29,7 @@
*/
#include "server.h"
+#include "functions.h"
#include <math.h>
#include <ctype.h>
@@ -1212,6 +1213,8 @@ struct redisMemOverhead *getMemoryOverheadData(void) {
}
mh->lua_caches = mem;
mem_total+=mem;
+ mh->functions_caches = functionsMemoryOverhead();
+ mem_total+=mh->functions_caches;
for (j = 0; j < server.dbnum; j++) {
redisDb *db = server.db+j;
@@ -1527,7 +1530,7 @@ NULL
} else if (!strcasecmp(c->argv[1]->ptr,"stats") && c->argc == 2) {
struct redisMemOverhead *mh = getMemoryOverheadData();
- addReplyMapLen(c,25+mh->num_dbs);
+ addReplyMapLen(c,26+mh->num_dbs);
addReplyBulkCString(c,"peak.allocated");
addReplyLongLong(c,mh->peak_allocated);
@@ -1553,6 +1556,9 @@ NULL
addReplyBulkCString(c,"lua.caches");
addReplyLongLong(c,mh->lua_caches);
+ addReplyBulkCString(c,"functions.caches");
+ addReplyLongLong(c,mh->functions_caches);
+
for (size_t j = 0; j < mh->num_dbs; j++) {
char dbname[32];
snprintf(dbname,sizeof(dbname),"db.%zd",mh->db[j].dbid);