]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
cpu plugin: Add "ReportUsage" to `config_keys`.
authorFlorian Forster <octo@collectd.org>
Fri, 19 Jan 2024 20:05:35 +0000 (21:05 +0100)
committerFlorian Forster <octo@collectd.org>
Mon, 22 Jan 2024 15:07:57 +0000 (16:07 +0100)
Also sort `config_keys`.

src/cpu.c

index 4c40dd6a81b80ce3a9e1db41a5aeb07d8e879a7f..35bd3c86adef2e634bb8b4fa55a19d0014108179 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -224,9 +224,9 @@ static bool report_guest;
 static bool subtract_guest = true;
 
 static const char *config_keys[] = {
-    "ReportByCpu",        "ReportByState",    "ReportNumCpu",
-    "ReportUtilization",  "ValuesPercentage", "ReportGuestState",
-    "SubtractGuestState",
+    "ReportByCpu",      "ReportByState",      "ReportGuestState",
+    "ReportNumCpu",     "ReportUsage",        "ReportUtilization",
+    "ValuesPercentage", "SubtractGuestState",
 };
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
@@ -234,17 +234,17 @@ static int cpu_config(char const *key, char const *value) /* {{{ */
 {
   if (strcasecmp(key, "ReportByCpu") == 0)
     report_by_cpu = IS_TRUE(value);
+  else if (strcasecmp(key, "ReportByState") == 0)
+    report_by_state = IS_TRUE(value);
+  else if (strcasecmp(key, "ReportGuestState") == 0)
+    report_guest = IS_TRUE(value);
+  else if (strcasecmp(key, "ReportNumCpu") == 0)
+    report_num_cpu = IS_TRUE(value);
   else if (strcasecmp(key, "ReportUsage") == 0)
     report_usage = IS_TRUE(value);
   else if (strcasecmp(key, "ReportUtilization") == 0 ||
            strcasecmp(key, "ValuesPercentage") == 0)
     report_utilization = IS_TRUE(value);
-  else if (strcasecmp(key, "ReportByState") == 0)
-    report_by_state = IS_TRUE(value);
-  else if (strcasecmp(key, "ReportNumCpu") == 0)
-    report_num_cpu = IS_TRUE(value);
-  else if (strcasecmp(key, "ReportGuestState") == 0)
-    report_guest = IS_TRUE(value);
   else if (strcasecmp(key, "SubtractGuestState") == 0)
     subtract_guest = IS_TRUE(value);
   else