]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
memory plugin: Rename `ValuesPercentage` to `ReportUtilization`.
authorFlorian Forster <octo@collectd.org>
Thu, 4 Jan 2024 06:28:18 +0000 (07:28 +0100)
committerFlorian Forster <octo@collectd.org>
Mon, 15 Jan 2024 14:21:58 +0000 (15:21 +0100)
src/collectd.conf.in
src/collectd.conf.pod
src/memory.c

index 4135898f4528666bb9394fd11f83976b5348b179..181fb147bcf42564e6c79e8287ac94846b13d52b 100644 (file)
 
 #<Plugin memory>
 #      ReportUsage true
-#      ValuesPercentage false
+#      ReportUtilization false
 #</Plugin>
 
 #<Plugin mmc>
index 6870342c198b0319b21e630998b77aebc95f03e2..9f47451fdec5cf73fb96a87a48ebc27a7a49e7f0 100644 (file)
@@ -5274,10 +5274,10 @@ The I<memory plugin> provides the following configuration options:
 Enables or disables reporting of physical memory usage in absolute numbers,
 i.e. bytes. Defaults to B<true>.
 
-=item B<ValuesPercentage> B<false>|B<true>
+=item B<ReportUtilization> B<false>|B<true>
 
-Enables or disables reporting of physical memory usage in percentages, e.g.
-percent of physical memory used. Defaults to B<false>.
+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<false>.
 
 This is useful for deploying I<collectd> in a heterogeneous environment in
 which the sizes of physical memory vary.
index 081d0a31f98be92a3669fb6c53e19ee32ed78daf..1e8520371ec4b3bf8215cef5dc5d254b4bacc406 100644 (file)
@@ -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;
   }