From c3c19993920077add3c746736cfaf438ced5fa96 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 20 May 2026 15:39:33 +0100 Subject: Add percentages to the sslinfo statistics. --- src/modules/m_sslinfo.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/modules/m_sslinfo.cpp') diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index e40773e78..4267f4d2f 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -538,15 +538,18 @@ public: counts[ciphersuite]++; } + const auto total = ServerInstance->Users.GetLocalUsers().size(); for (const auto& [ciphersuite, count] : counts) { if (!count) continue; - stats.AddGenericRow(INSP_FORMAT("{}: {}", ciphersuite, count)) + const auto percent = total ? round((count * 100) / total) : 0; + stats.AddGenericRow(INSP_FORMAT("{}: {} ({:3.2f}%)", ciphersuite, count, percent)) .AddTags(stats, { - { "ciphersuite", ciphersuite }, - { "count", ConvToStr(count) }, + { "ciphersuite", ciphersuite }, + { "count", ConvToStr(count) }, + { "percent", INSP_FORMAT("{:3.2f}", percent) }, }); } return MOD_RES_DENY; -- cgit v1.3.1-10-gc9f91