From 41733d733f7d228e7b8954e2534124a347b9e520 Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 20 Mar 2024 19:21:13 +0000 Subject: [PATCH] Add data on actual disk used that is compared to maxstorage --- src/modules/keydb_modstatsd/modmain.cpp | 1 + src/server.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/keydb_modstatsd/modmain.cpp b/src/modules/keydb_modstatsd/modmain.cpp index f6a5c0ee2..970082fa5 100644 --- a/src/modules/keydb_modstatsd/modmain.cpp +++ b/src/modules/keydb_modstatsd/modmain.cpp @@ -101,6 +101,7 @@ std::unordered_map g_mapInfoFields = { { "used_memory_rss", { StatsD_Type::STATSD_GAUGE_BYTES }}, { "maxmemory", { StatsD_Type::STATSD_GAUGE_BYTES, false /* prefixOnly */}}, { "maxstorage", { StatsD_Type::STATSD_GAUGE_BYTES, false /* prefixOnly */}}, + { "storage_used", { 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 }}, diff --git a/src/server.cpp b/src/server.cpp index 10cb25f2f..ece3bce63 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -5827,7 +5827,8 @@ sds genRedisInfoString(const char *section) { "lazyfreed_objects:%zu\r\n" "storage_provider:%s\r\n" "available_system_memory:%s\r\n" - "maxstorage:%llu\r\n", + "maxstorage:%llu\r\n" + "storage_used:%llu\r\n", zmalloc_used, hmem, g_pserver->cron_malloc_stats.process_rss, @@ -5874,7 +5875,8 @@ sds genRedisInfoString(const char *section) { lazyfreeGetFreedObjectsCount(), g_pserver->m_pstorageFactory ? g_pserver->m_pstorageFactory->name() : "none", available_system_mem, - g_pserver->maxstorage + g_pserver->maxstorage, + g_pserver->m_pstorageFactory ? g_pserver->m_pstorageFactory->totalDiskspaceUsed() : 0 ); freeMemoryOverheadData(mh); }