feat(cpu): Add ramp-coreload-spacing (#1472)

Resolves #1389
This commit is contained in:
Patrick Ziegler 2018-10-16 01:11:05 +02:00 committed by GitHub
parent 6d0cfbdfde
commit b80023fd41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -37,6 +37,7 @@ namespace modules {
ramp_t m_rampload;
ramp_t m_rampload_core;
label_t m_label;
int m_ramp_padding;
vector<cpu_time_t> m_cputimes;
vector<cpu_time_t> m_cputimes_prev;

View File

@ -18,6 +18,8 @@ namespace modules {
cpu_module::cpu_module(const bar_settings& bar, string name_) : timer_module<cpu_module>(bar, move(name_)) {
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 1s);
m_ramp_padding = m_conf.get<decltype(m_ramp_padding)>(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));
}