]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
metrics: fixing casing
authorYaping Li <202858510+YapingLi04@users.noreply.github.com>
Wed, 11 Feb 2026 23:08:44 +0000 (15:08 -0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 13 Feb 2026 07:55:25 +0000 (16:55 +0900)
TODO
src/core/varlink-metrics.c
src/shared/varlink-io.systemd.Metrics.c

diff --git a/TODO b/TODO
index b7b37fcbcd31a8994ed63c04d86902f876e3367d..a970f59c58c92b1f291238854b7cb8ea6cea3805 100644 (file)
--- a/TODO
+++ b/TODO
@@ -124,7 +124,6 @@ Features:
 * report:
   - should the list of metrics use JSON-SEQ? or maybe be wrapped in a json
     array (the latter might be necessary, once we sign the combination)
-  - "io.systemd.Manager.unit_active_state" is a weird mix of CamelCase and snake_case
   - metrics from pid1: suppress metrics form units that are inactive and have nothing to report
   - how to plug facts into this? i.e. hostname, ssh keys, and so on
   - switch to daan's suggested hierarchy?
index 3929f3a621e55c1daa35054ef37f72d5721d92f9..15bd1f154c4a28070b363171c08da515a09efd12 100644 (file)
@@ -141,33 +141,33 @@ static int units_by_state_total_build_json(MetricFamilyContext *context, void *u
 }
 
 const MetricFamily metric_family_table[] = {
-        // Keep metrics ordered alphabetically
+        /* 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 "unit_active_state",
+         .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 "unit_load_state",
+         .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 "units_by_state_total",
+         .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 "units_by_type_total",
+         .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 b47f96d0aa33c7514f64b1799ab6ef755872bb6f..e9d463e9fd5fd7b43042667c9b9fd55f4107a6a3 100644 (file)
@@ -18,7 +18,7 @@ static SD_VARLINK_DEFINE_ERROR(NoSuchMetric);
 static SD_VARLINK_DEFINE_METHOD_FULL(
                 List,
                 SD_VARLINK_REQUIRES_MORE,
-                SD_VARLINK_FIELD_COMMENT("Metric name, e.g. io.systemd.Manager.units_by_type_total or io.systemd.Manager.unit_active_state"),
+                SD_VARLINK_FIELD_COMMENT("Metric name, e.g. io.systemd.Manager.unitsByTypeTotal or io.systemd.Manager.unitActiveState"),
                 SD_VARLINK_DEFINE_OUTPUT(name, SD_VARLINK_STRING, 0),
                 /* metric value has various types depending on MetricFamilyType and actual data double/int/uint */
                 SD_VARLINK_FIELD_COMMENT("Metric value"),