diff --git a/CHANGELOG.md b/CHANGELOG.md index e64acd0..196202a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ### Changed * disk-io: `interval` renamed to `poll-interval` +* mem: `interval` renamed to `poll-interval` ### Deprecated diff --git a/doc/yambar-modules-mem.5.scd b/doc/yambar-modules-mem.5.scd index 82a70c3..82710c3 100644 --- a/doc/yambar-modules-mem.5.scd +++ b/doc/yambar-modules-mem.5.scd @@ -30,10 +30,11 @@ mem - This module provides the memory usage :[ *Type* :[ *Req* :< *Description* -| interval +| poll-interval : string : no -: Refresh interval of the memory usage stats in ms (default=500). Cannot be less then 500 ms +: Refresh interval of the memory usage stats in ms + (default=500). Cannot be less then 500 ms. # EXAMPLES @@ -41,7 +42,7 @@ mem - This module provides the memory usage bar: left: - mem: - interval: 2500 + poll-interval: 2500 content: string: {text: "{used:mb}MB"} ``` diff --git a/modules/mem.c b/modules/mem.c index 339501b..417c8df 100644 --- a/modules/mem.c +++ b/modules/mem.c @@ -151,10 +151,12 @@ mem_new(uint16_t interval, struct particle *label) static struct module * from_conf(const struct yml_node *node, struct conf_inherit inherited) { - const struct yml_node *interval = yml_get_value(node, "interval"); + const struct yml_node *interval = yml_get_value(node, "poll-interval"); const struct yml_node *c = yml_get_value(node, "content"); - return mem_new(interval == NULL ? SMALLEST_INTERVAL : yml_value_as_int(interval), conf_to_particle(c, inherited)); + return mem_new( + interval == NULL ? SMALLEST_INTERVAL : yml_value_as_int(interval), + conf_to_particle(c, inherited)); } static bool @@ -175,7 +177,7 @@ static bool verify_conf(keychain_t *chain, const struct yml_node *node) { static const struct attr_info attrs[] = { - {"interval", false, &conf_verify_interval}, + {"poll-interval", false, &conf_verify_interval}, MODULE_COMMON_ATTRS, };