Skip to content

Commit

Permalink
feat(cpu): Add percentage-sum token (#1517)
Browse files Browse the repository at this point in the history
Adds `%percentage-sum%` token to cpu label that contains the cumulative load of all cores.
  • Loading branch information
BigRedEye authored and patrick96 committed Dec 3, 2018
1 parent 35c0c4a commit cc8947a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/modules/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit cc8947a

Please sign in to comment.