]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
swap plugin: Populate the `unit` field.
authorFlorian Forster <octo@collectd.org>
Wed, 10 Jan 2024 21:19:58 +0000 (22:19 +0100)
committerFlorian Forster <octo@collectd.org>
Fri, 26 Jan 2024 13:32:14 +0000 (14:32 +0100)
src/swap.c

index e79f4fbc0988fecdc260e8a0a01b8b3615566353..93d68618daaf0cb3082ed60000bca36b577f8e7d 100644 (file)
@@ -810,24 +810,28 @@ static int swap_read(void) {
           {
               .name = "system.paging.usage",
               .help = "Unix swap usage",
+              .unit = "By",
               .type = METRIC_TYPE_GAUGE,
           },
       [FAM_SWAP_UTILIZATION] =
           {
               .name = "system.paging.utilization",
               .help = "Unix swap utilization",
+              .unit = "1",
               .type = METRIC_TYPE_GAUGE,
           },
       [FAM_SWAP_OPS] =
           {
               /* used when report_io && !report_bytes */
               .name = "system.paging.operations",
+              .unit = "{operation}",
               .type = METRIC_TYPE_COUNTER,
           },
       [FAM_SWAP_IO] =
           {
               /* used when report_io && report_bytes */
               .name = "system.paging.io",
+              .unit = "By",
               .type = METRIC_TYPE_COUNTER,
           },
   };