diff options
| author | 2026-05-20 15:39:33 +0100 | |
|---|---|---|
| committer | 2026-05-20 15:39:33 +0100 | |
| commit | c3c19993920077add3c746736cfaf438ced5fa96 (patch) | |
| tree | 8f55c268bf92447ed770b4188329dea9d607cce2 /src/modules/m_sslinfo.cpp | |
| parent | Fix 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.cpp | 9 |
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; |
