From cc8947ac01d2725a124222416ff9b332986ea17d Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 3 Dec 2018 03:48:18 +0300 Subject: [PATCH] feat(cpu): Add percentage-sum token (#1517) Adds `%percentage-sum%` token to cpu label that contains the cumulative load of all cores. --- src/modules/cpu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/cpu.cpp b/src/modules/cpu.cpp index 9b3eb39e..56f05535 100644 --- a/src/modules/cpu.cpp +++ b/src/modules/cpu.cpp @@ -69,6 +69,7 @@ namespace modules { if (m_label) { m_label->reset_tokens(); m_label->replace_token("%percentage%", to_string(static_cast(m_total + 0.5))); + m_label->replace_token("%percentage-sum%", to_string(static_cast(m_total * static_cast(cores_n) + 0.5))); m_label->replace_token("%percentage-cores%", string_util::join(percentage_cores, "% ") + "%"); for (size_t i = 0; i < percentage_cores.size(); i++) {