feat(cpu): Add percentage-sum token (#1517)

Adds `%percentage-sum%` token to cpu label that contains the cumulative load of all cores.
This commit is contained in:
Sergey 2018-12-03 03:48:18 +03:00 committed by Patrick Ziegler
parent 35c0c4a343
commit cc8947ac01

View File

@ -69,6 +69,7 @@ namespace modules {
if (m_label) {
m_label->reset_tokens();
m_label->replace_token("%percentage%", to_string(static_cast<int>(m_total + 0.5)));
m_label->replace_token("%percentage-sum%", to_string(static_cast<int>(m_total * static_cast<float>(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++) {