From: Florian Forster Date: Thu, 4 Jan 2024 06:28:18 +0000 (+0100) Subject: memory plugin: Rename `ValuesPercentage` to `ReportUtilization`. X-Git-Tag: 6.0.0-rc0~10^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5877b8d0706523db616818df8b1ac3b797ecf58e;p=thirdparty%2Fcollectd.git memory plugin: Rename `ValuesPercentage` to `ReportUtilization`. --- diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 4135898f4..181fb147b 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -1057,7 +1057,7 @@ # # ReportUsage true -# ValuesPercentage false +# ReportUtilization false # # diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 6870342c1..9f47451fd 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -5274,10 +5274,10 @@ The I provides the following configuration options: Enables or disables reporting of physical memory usage in absolute numbers, i.e. bytes. Defaults to B. -=item B B|B +=item B B|B -Enables or disables reporting of physical memory usage in percentages, e.g. -percent of physical memory used. Defaults to B. +Enables or disables reporting of physical memory usage as a ratio of total +memory, e.g. the fraction of physical memory used. Defaults to B. This is useful for deploying I in a heterogeneous environment in which the sizes of physical memory vary. diff --git a/src/memory.c b/src/memory.c index 081d0a31f..1e8520371 100644 --- a/src/memory.c +++ b/src/memory.c @@ -150,7 +150,7 @@ static int pagesize; #endif static bool report_usage = true; -static bool values_percentage; +static bool report_utilization; static int memory_config(oconfig_item_t *ci) /* {{{ */ { @@ -159,8 +159,9 @@ static int memory_config(oconfig_item_t *ci) /* {{{ */ if (strcasecmp("ReportUsage", child->key) == 0 || strcasecmp("ValuesAbsolute", child->key) == 0) cf_util_get_boolean(child, &report_usage); - else if (strcasecmp("ValuesPercentage", child->key) == 0) - cf_util_get_boolean(child, &values_percentage); + else if (strcasecmp("ReportUtilization", child->key) == 0 || + strcasecmp("ValuesPercentage", child->key) == 0) + cf_util_get_boolean(child, &report_utilization); else ERROR("memory plugin: Invalid configuration option: \"%s\".", child->key); } @@ -201,7 +202,7 @@ static int memory_dispatch(gauge_t values[COLLECTD_MEMORY_TYPE_MAX]) { } metric_family_metric_reset(&fam_usage); - if (!values_percentage) { + if (!report_utilization) { return ret; }