Skip to content

Commit

Permalink
Update server function's name to valkey (#456)
Browse files Browse the repository at this point in the history
Updated valkey in follwing functions.

genRedisInfoString -> genValkeyInfoString
genRedisInfoStringCommandStats -> genValkeyInfoStringCommandStats
genRedisInfoStringACLStats -> genValkeyInfoStringACLStats
genRedisInfoStringLatencyStats -> genValkeyInfoStringLatencyStats

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
  • Loading branch information
Shivshankar-Reddy committed May 8, 2024
1 parent 4e944ce commit 315b757
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ void logServerInfo(void) {
robj *argv[1];
argv[0] = createStringObject("all", strlen("all"));
dict *section_dict = genInfoSectionDict(argv, 1, NULL, &all, &everything);
infostring = genRedisInfoString(section_dict, all, everything);
infostring = genValkeyInfoString(section_dict, all, everything);
if (server.cluster_enabled){
infostring = genClusterDebugString(infostring);
}
Expand Down
2 changes: 1 addition & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -10447,7 +10447,7 @@ ValkeyModuleServerInfoData *VM_GetServerInfo(ValkeyModuleCtx *ctx, const char *s
robj *argv[1];
argv[0] = section ? createStringObject(section, strlen(section)) : NULL;
dict *section_dict = genInfoSectionDict(argv, section ? 1 : 0, NULL, &all, &everything);
sds info = genRedisInfoString(section_dict, all, everything);
sds info = genValkeyInfoString(section_dict, all, everything);
int totlines, i;
sds *lines = sdssplitlen(info, sdslen(info), "\r\n", 2, &totlines);
for(i=0; i<totlines; i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/sentinel.c
Original file line number Diff line number Diff line change
Expand Up @@ -4265,7 +4265,7 @@ void sentinelInfoCommand(client *c) {
}
dictReleaseIterator(di);

/* Insert explicit all sections (don't pass these vars to genRedisInfoString) */
/* Insert explicit all sections (don't pass these vars to genValkeyInfoString) */
if (sec_all || sec_everything) {
releaseInfoSectionDict(sections_dict);
/* We cache this dict as an optimization. */
Expand All @@ -4276,7 +4276,7 @@ void sentinelInfoCommand(client *c) {
sections_dict = cached_all_info_sections;
}

sds info = genRedisInfoString(sections_dict, 0, 0);
sds info = genValkeyInfoString(sections_dict, 0, 0);
if (sec_all || (dictFind(sections_dict, "sentinel") != NULL)) {
dictIterator *di;
dictEntry *de;
Expand Down
22 changes: 11 additions & 11 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -5432,7 +5432,7 @@ const char *getSafeInfoString(const char *s, size_t len, char **tmp) {
sizeof(unsafe_info_chars)-1);
}

sds genRedisInfoStringCommandStats(sds info, dict *commands) {
sds genValkeyInfoStringCommandStats(sds info, dict *commands) {
struct serverCommand *c;
dictEntry *de;
dictIterator *di;
Expand All @@ -5450,7 +5450,7 @@ sds genRedisInfoStringCommandStats(sds info, dict *commands) {
if (tmpsafe != NULL) zfree(tmpsafe);
}
if (c->subcommands_dict) {
info = genRedisInfoStringCommandStats(info, c->subcommands_dict);
info = genValkeyInfoStringCommandStats(info, c->subcommands_dict);
}
}
dictReleaseIterator(di);
Expand All @@ -5459,7 +5459,7 @@ sds genRedisInfoStringCommandStats(sds info, dict *commands) {
}

/* Writes the ACL metrics to the info */
sds genRedisInfoStringACLStats(sds info) {
sds genValkeyInfoStringACLStats(sds info) {
info = sdscatprintf(info,
"acl_access_denied_auth:%lld\r\n"
"acl_access_denied_cmd:%lld\r\n"
Expand All @@ -5472,7 +5472,7 @@ sds genRedisInfoStringACLStats(sds info) {
return info;
}

sds genRedisInfoStringLatencyStats(sds info, dict *commands) {
sds genValkeyInfoStringLatencyStats(sds info, dict *commands) {
struct serverCommand *c;
dictEntry *de;
dictIterator *di;
Expand All @@ -5487,7 +5487,7 @@ sds genRedisInfoStringLatencyStats(sds info, dict *commands) {
if (tmpsafe != NULL) zfree(tmpsafe);
}
if (c->subcommands_dict) {
info = genRedisInfoStringLatencyStats(info, c->subcommands_dict);
info = genValkeyInfoStringLatencyStats(info, c->subcommands_dict);
}
}
dictReleaseIterator(di);
Expand All @@ -5513,7 +5513,7 @@ void releaseInfoSectionDict(dict *sec) {
dictRelease(sec);
}

/* Create a dictionary with unique section names to be used by genRedisInfoString.
/* Create a dictionary with unique section names to be used by genValkeyInfoString.
* 'argv' and 'argc' are list of arguments for INFO.
* 'defaults' is an optional null terminated list of default sections.
* 'out_all' and 'out_everything' are optional.
Expand Down Expand Up @@ -5577,7 +5577,7 @@ void totalNumberOfStatefulKeys(unsigned long *blocking_keys, unsigned long *bloc
/* Create the string returned by the INFO command. This is decoupled
* by the INFO command itself as we need to report the same information
* on memory corruption problems. */
sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
sds genValkeyInfoString(dict *section_dict, int all_sections, int everything) {
sds info = sdsempty();
time_t uptime = server.unixtime-server.stat_starttime;
int j;
Expand Down Expand Up @@ -5942,7 +5942,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
"eventloop_duration_cmd_sum:%llu\r\n", server.duration_stats[EL_DURATION_TYPE_CMD].sum,
"instantaneous_eventloop_cycles_per_sec:%llu\r\n", getInstantaneousMetric(STATS_METRIC_EL_CYCLE),
"instantaneous_eventloop_duration_usec:%llu\r\n", getInstantaneousMetric(STATS_METRIC_EL_DURATION)));
info = genRedisInfoStringACLStats(info);
info = genValkeyInfoStringACLStats(info);
}

/* Replication */
Expand Down Expand Up @@ -6092,7 +6092,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
if (all_sections || (dictFind(section_dict,"commandstats") != NULL)) {
if (sections++) info = sdscat(info,"\r\n");
info = sdscatprintf(info, "# Commandstats\r\n");
info = genRedisInfoStringCommandStats(info, server.commands);
info = genValkeyInfoStringCommandStats(info, server.commands);
}

/* Error statistics */
Expand All @@ -6119,7 +6119,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
if (sections++) info = sdscat(info,"\r\n");
info = sdscatprintf(info, "# Latencystats\r\n");
if (server.latency_tracking_enabled) {
info = genRedisInfoStringLatencyStats(info, server.commands);
info = genValkeyInfoStringLatencyStats(info, server.commands);
}
}

Expand Down Expand Up @@ -6185,7 +6185,7 @@ void infoCommand(client *c) {
int all_sections = 0;
int everything = 0;
dict *sections_dict = genInfoSectionDict(c->argv+1, c->argc-1, NULL, &all_sections, &everything);
sds info = genRedisInfoString(sections_dict, all_sections, everything);
sds info = genValkeyInfoString(sections_dict, all_sections, everything);
addReplyVerbatim(c,info,sdslen(info),"txt");
sdsfree(info);
releaseInfoSectionDict(sections_dict);
Expand Down
4 changes: 2 additions & 2 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -2975,7 +2975,7 @@ void ACLFreeUserAndKillClients(user *u);
void addACLLogEntry(client *c, int reason, int context, int argpos, sds username, sds object);
sds getAclErrorMessage(int acl_res, user *user, struct serverCommand *cmd, sds errored_val, int verbose);
void ACLUpdateDefaultUserPassword(sds password);
sds genRedisInfoStringACLStats(sds info);
sds genValkeyInfoStringACLStats(sds info);
void ACLRecomputeCommandBitsFromCommandRulesAllUsers(void);

/* Sorted sets data type */
Expand Down Expand Up @@ -3766,7 +3766,7 @@ void removeSigSegvHandlers(void);
const char *getSafeInfoString(const char *s, size_t len, char **tmp);
dict *genInfoSectionDict(robj **argv, int argc, char **defaults, int *out_all, int *out_everything);
void releaseInfoSectionDict(dict *sec);
sds genRedisInfoString(dict *section_dict, int all_sections, int everything);
sds genValkeyInfoString(dict *section_dict, int all_sections, int everything);
sds genModulesInfoString(sds info);
void applyWatchdogPeriod(void);
void watchdogScheduleSignal(int period);
Expand Down

0 comments on commit 315b757

Please sign in to comment.