Skip to content

Commit

Permalink
Emit maxstorage metric
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Mar 7, 2024
1 parent 6c15c43 commit fe5503a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/modules/keydb_modstatsd/modmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ std::unordered_map<std::string, StatsRecord> g_mapInfoFields = {
{ "used_memory", { StatsD_Type::STATSD_GAUGE_BYTES, false /* prefixOnly */}},
{ "used_memory_rss", { StatsD_Type::STATSD_GAUGE_BYTES }},
{ "maxmemory", { StatsD_Type::STATSD_GAUGE_BYTES, false /* prefixOnly */}},
{ "maxstorage", { StatsD_Type::STATSD_GAUGE_BYTES, false /* prefixOnly */}},
{ "used_memory_dataset_perc", { StatsD_Type::STATSD_GAUGE_FLOAT }},
{ "avg_lock_contention", { StatsD_Type::STATSD_GAUGE_LONGLONG }},
{ "repl_backlog_size", { StatsD_Type::STATSD_GAUGE_BYTES }},
Expand Down
6 changes: 4 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5826,7 +5826,8 @@ sds genRedisInfoString(const char *section) {
"lazyfree_pending_objects:%zu\r\n"
"lazyfreed_objects:%zu\r\n"
"storage_provider:%s\r\n"
"available_system_memory:%s\r\n",
"available_system_memory:%s\r\n"
"maxstorage:%llu\r\n",
zmalloc_used,
hmem,
g_pserver->cron_malloc_stats.process_rss,
Expand Down Expand Up @@ -5872,7 +5873,8 @@ sds genRedisInfoString(const char *section) {
lazyfreeGetPendingObjectsCount(),
lazyfreeGetFreedObjectsCount(),
g_pserver->m_pstorageFactory ? g_pserver->m_pstorageFactory->name() : "none",
available_system_mem
available_system_mem,
g_pserver->maxstorage
);
freeMemoryOverheadData(mh);
}
Expand Down

0 comments on commit fe5503a

Please sign in to comment.