Merge branch 'add_storage_provider_data_to_INFO' into 'keydbpro'

add stats for storage provider reads

See merge request keydb-dev/KeyDB-Pro!39

Former-commit-id: 07bb08a8bc89350f4addb9dfd77435217c6b46d5
This commit is contained in:
jsully 2021-09-01 19:21:05 +00:00
commit 977b3e74be
3 changed files with 10 additions and 2 deletions

View File

@ -2801,8 +2801,10 @@ LNotFound:
serverAssert(m_setexpire->find(sdsKey) != m_setexpire->end());
}
serverAssert(o->FExpires() == (m_setexpire->find(sdsKey) != m_setexpire->end()));
g_pserver->stat_storage_provider_read_hits++;
} else {
sdsfree(sdsNewKey);
g_pserver->stat_storage_provider_read_misses++;
}
*pde = dictFind(m_pdict, sdsKey);

View File

@ -5798,7 +5798,9 @@ sds genRedisInfoString(const char *section) {
"total_reads_processed:%lld\r\n"
"total_writes_processed:%lld\r\n"
"instantaneous_lock_contention:%d\r\n"
"avg_lock_contention:%f\r\n",
"avg_lock_contention:%f\r\n"
"storage_provider_read_hits:%lld\r\n"
"storage_provider_read_misses:%lld\r\n",
g_pserver->stat_numconnections,
g_pserver->stat_numcommands,
getInstantaneousMetric(STATS_METRIC_COMMAND),
@ -5836,7 +5838,9 @@ sds genRedisInfoString(const char *section) {
stat_total_reads_processed,
stat_total_writes_processed,
aeLockContention(),
avgLockContention);
avgLockContention,
g_pserver->stat_storage_provider_read_hits,
g_pserver->stat_storage_provider_read_misses);
}
/* Replication */

View File

@ -2242,6 +2242,8 @@ struct redisServer {
long long stat_dump_payload_sanitizations; /* Number deep dump payloads integrity validations. */
std::atomic<long long> stat_total_reads_processed; /* Total number of read events processed */
std::atomic<long long> stat_total_writes_processed; /* Total number of write events processed */
long long stat_storage_provider_read_hits;
long long stat_storage_provider_read_misses;
/* The following two are used to track instantaneous metrics, like
* number of operations per second, network traffic. */
struct {