From b80023fd411b2b3a3e2bd460b95f30af7fb2853a Mon Sep 17 00:00:00 2001
From: Patrick Ziegler
Date: Tue, 16 Oct 2018 01:11:05 +0200
Subject: [PATCH] feat(cpu): Add ramp-coreload-spacing (#1472)
Resolves #1389
---
include/modules/cpu.hpp | 1 +
src/modules/cpu.cpp | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/modules/cpu.hpp b/include/modules/cpu.hpp
index f301ff76..9c310788 100644
--- a/include/modules/cpu.hpp
+++ b/include/modules/cpu.hpp
@@ -37,6 +37,7 @@ namespace modules {
ramp_t m_rampload;
ramp_t m_rampload_core;
label_t m_label;
+ int m_ramp_padding;
vector m_cputimes;
vector m_cputimes_prev;
diff --git a/src/modules/cpu.cpp b/src/modules/cpu.cpp
index 387c6df0..9b3eb39e 100644
--- a/src/modules/cpu.cpp
+++ b/src/modules/cpu.cpp
@@ -18,6 +18,8 @@ namespace modules {
cpu_module::cpu_module(const bar_settings& bar, string name_) : timer_module(bar, move(name_)) {
m_interval = m_conf.get(name(), "interval", 1s);
+ m_ramp_padding = m_conf.get(name(), "ramp-coreload-spacing", 1);
+
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL, TAG_BAR_LOAD, TAG_RAMP_LOAD, TAG_RAMP_LOAD_PER_CORE});
// warmup cpu times
@@ -88,7 +90,7 @@ namespace modules {
auto i = 0;
for (auto&& load : m_load) {
if (i++ > 0) {
- builder->space(1);
+ builder->space(m_ramp_padding);
}
builder->node(m_rampload_core->get_by_percentage(load));
}