]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/varlink-metrics: make metric_family_table static
authorMike Yuan <me@yhndnzj.com>
Wed, 4 Mar 2026 12:11:50 +0000 (13:11 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 4 Mar 2026 13:32:16 +0000 (14:32 +0100)
src/core/varlink-metrics.c

index c492b0c04d315e6ffb31b1d950b2ac9ead440434..00af452d7776c5f5bda0414553d7b24c11e36c96 100644 (file)
@@ -143,37 +143,37 @@ static int units_by_state_total_build_json(MetricFamilyContext *context, void *u
         return 0;
 }
 
-const MetricFamily metric_family_table[] = {
+static const MetricFamily metric_family_table[] = {
         /* Keep metrics ordered alphabetically */
         {
-         .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "NRestarts",
-         .description = "Per unit metric: number of restarts",
-         .type = METRIC_FAMILY_TYPE_COUNTER,
-         .generate = nrestarts_build_json,
+                .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "NRestarts",
+                .description = "Per unit metric: number of restarts",
+                .type = METRIC_FAMILY_TYPE_COUNTER,
+                .generate = nrestarts_build_json,
         },
         {
-         .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "UnitActiveState",
-         .description = "Per unit metric: active state",
-         .type = METRIC_FAMILY_TYPE_STRING,
-         .generate = unit_active_state_build_json,
+                .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "UnitActiveState",
+                .description = "Per unit metric: active state",
+                .type = METRIC_FAMILY_TYPE_STRING,
+                .generate = unit_active_state_build_json,
         },
         {
-         .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "UnitLoadState",
-         .description = "Per unit metric: load state",
-         .type = METRIC_FAMILY_TYPE_STRING,
-         .generate = unit_load_state_build_json,
+                .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "UnitLoadState",
+                .description = "Per unit metric: load state",
+                .type = METRIC_FAMILY_TYPE_STRING,
+                .generate = unit_load_state_build_json,
         },
         {
-         .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "UnitsByStateTotal",
-         .description = "Total number of units of different state",
-         .type = METRIC_FAMILY_TYPE_GAUGE,
-         .generate = units_by_state_total_build_json,
+                .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "UnitsByStateTotal",
+                .description = "Total number of units of different state",
+                .type = METRIC_FAMILY_TYPE_GAUGE,
+                .generate = units_by_state_total_build_json,
         },
         {
-         .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "UnitsByTypeTotal",
-         .description = "Total number of units of different types",
-         .type = METRIC_FAMILY_TYPE_GAUGE,
-         .generate = units_by_type_total_build_json,
+                .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "UnitsByTypeTotal",
+                .description = "Total number of units of different types",
+                .type = METRIC_FAMILY_TYPE_GAUGE,
+                .generate = units_by_type_total_build_json,
         },
         {}
 };