Add snapshot depth to info string

Former-commit-id: 66aef678e9d6d7ab6c28622d54ada0ea8cdd2a99
This commit is contained in:
John Sully 2020-08-16 00:27:10 +00:00
parent 4a356ac13f
commit 00934cd341

View File

@ -5187,12 +5187,20 @@ sds genRedisInfoString(const char *section) {
}
if (allsections || defsections || !strcasecmp(section,"keydb")) {
// Compute the MVCC depth
int mvcc_depth = 0;
for (int idb = 0; idb < cserver.dbnum; ++idb) {
mvcc_depth = std::max(mvcc_depth, g_pserver->db[idb]->snapshot_depth());
}
if (sections++) info = sdscat(info,"\r\n");
info = sdscatprintf(info,
"# KeyDB\r\n"
"variant:pro\r\n"
"license_status:%s\r\n",
cserver.license_key ? "OK" : "Trial"
"license_status:%s\r\n"
"mvcc_depth:%d\r\n",
cserver.license_key ? "OK" : "Trial",
mvcc_depth
);
}