aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_sslinfo.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-05-20 15:39:33 +0100
committerGravatar Sadie Powell2026-05-20 15:39:33 +0100
commitc3c19993920077add3c746736cfaf438ced5fa96 (patch)
tree8f55c268bf92447ed770b4188329dea9d607cce2 /src/modules/m_sslinfo.cpp
parentFix some LIST filter edge cases. (diff)
Add percentages to the sslinfo statistics.
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
-rw-r--r--src/modules/m_sslinfo.cpp9
1 files changed, 6 insertions, 3 deletions
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;