]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
metrics: fix casing for metrics names (take 2)
authorYaping Li <202858510+YapingLi04@users.noreply.github.com>
Wed, 18 Feb 2026 21:58:11 +0000 (13:58 -0800)
committerLennart Poettering <lennart@poettering.net>
Thu, 19 Feb 2026 14:30:18 +0000 (15:30 +0100)
Change the casing for metrics names to mimic properties exposed via
varlink/dbus: Use PascalCase.

src/core/varlink-metrics.c
src/network/networkd-varlink-metrics.c

index 1bfdb1f5d7a122eb004a6c55eea741edf7dce0e6..c492b0c04d315e6ffb31b1d950b2ac9ead440434 100644 (file)
@@ -146,31 +146,31 @@ static int units_by_state_total_build_json(MetricFamilyContext *context, void *u
 const MetricFamily metric_family_table[] = {
         /* Keep metrics ordered alphabetically */
         {
-         .name = METRIC_IO_SYSTEMD_MANAGER_PREFIX "nRestarts",
+         .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",
+         .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",
+         .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",
+         .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",
+         .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,
index 1853bfdb8329ccb0a5d0e5b983e3a6ef2f3ff8f7..d37f65b43d2a127075ea3f62c434521556f687a9 100644 (file)
@@ -102,43 +102,43 @@ static int managed_interfaces_build_json(MetricFamilyContext *context, void *use
 /* Keep metrics ordered alphabetically */
 static const MetricFamily network_metric_family_table[] = {
         {
-                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "addressState",
+                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "AddressState",
                 .description = "Per interface metric: address state",
                 .type = METRIC_FAMILY_TYPE_STRING,
                 .generate = link_address_state_build_json,
         },
         {
-                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "adminState",
-                .description = "Per interface metric: admin state",
+                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "AdministrativeState",
+                .description = "Per interface metric: administrative state",
                 .type = METRIC_FAMILY_TYPE_STRING,
                 .generate = link_admin_state_build_json,
         },
         {
-                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "carrierState",
+                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "CarrierState",
                 .description = "Per interface metric: carrier state",
                 .type = METRIC_FAMILY_TYPE_STRING,
                 .generate = link_carrier_state_build_json,
         },
         {
-                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "ipv4AddressState",
+                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "IPv4AddressState",
                 .description = "Per interface metric: IPv4 address state",
                 .type = METRIC_FAMILY_TYPE_STRING,
                 .generate = link_ipv4_address_state_build_json,
         },
         {
-                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "ipv6AddressState",
+                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "IPv6AddressState",
                 .description = "Per interface metric: IPv6 address state",
                 .type = METRIC_FAMILY_TYPE_STRING,
                 .generate = link_ipv6_address_state_build_json,
         },
         {
-                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "managedInterfaces",
+                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "ManagedInterfaces",
                 .description = "Number of network interfaces managed by systemd-networkd",
                 .type = METRIC_FAMILY_TYPE_GAUGE,
                 .generate = managed_interfaces_build_json,
         },
         {
-                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "operationalState",
+                .name = METRIC_IO_SYSTEMD_NETWORK_PREFIX "OperationalState",
                 .description = "Per interface metric: operational state",
                 .type = METRIC_FAMILY_TYPE_STRING,
                 .generate = link_oper_state_build_json,