MCPcopy Create free account
hub / github.com/F-Stack/f-stack / getDbSize

Function getDbSize

app/redis-6.2.6/src/redis-cli.c:7486–7508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7484}
7485
7486static int getDbSize(void) {
7487 redisReply *reply;
7488 int size;
7489
7490 reply = redisCommand(context, "DBSIZE");
7491
7492 if (reply == NULL) {
7493 fprintf(stderr, "\nI/O error\n");
7494 exit(1);
7495 } else if (reply->type == REDIS_REPLY_ERROR) {
7496 fprintf(stderr, "Couldn't determine DBSIZE: %s\n", reply->str);
7497 exit(1);
7498 } else if (reply->type != REDIS_REPLY_INTEGER) {
7499 fprintf(stderr, "Non INTEGER response from DBSIZE!\n");
7500 exit(1);
7501 }
7502
7503 /* Grab the number of keys and free our reply */
7504 size = reply->integer;
7505 freeReplyObject(reply);
7506
7507 return size;
7508}
7509
7510typedef struct {
7511 char *name;

Callers 2

findBigKeysFunction · 0.85
findHotKeysFunction · 0.85

Calls 2

freeReplyObjectFunction · 0.85
redisCommandClass · 0.70

Tested by

no test coverage detected