]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: use stat_col storage stat_cols_info
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 17 Mar 2025 10:37:10 +0000 (11:37 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 20 Mar 2025 10:38:32 +0000 (11:38 +0100)
Use stat_col storage for stat_cols_info[] array instead of name_desc.

As documented in 65624876f ("MINOR: stats: introduce a more expressive
stat definition method"), stat_col supersedes name_desc storage but
it remains backward compatible. Here we migrate to the new API to be
able to further extend stat_cols_info[] in following patches.

include/haproxy/stats.h
src/stats.c

index af9965281971e725273fea0502a60dd1f73a0417..f292ba4dd9118b91596b636ce83ebc51de8c6916 100644 (file)
@@ -39,7 +39,7 @@ struct stconn;
  * the the number of entries in "enum stat_idx_px" and "enum stat_idx_info"
  */
 extern const struct stat_col stat_cols_px[];
-extern const struct name_desc stat_cols_info[];
+extern const struct stat_col stat_cols_info[];
 extern const char *stat_status_codes[];
 extern struct applet http_stats_applet;
 extern struct list stats_module_list[];
index 1e5461b5b0b531ab72a11db4d484809d1d9ddc76..6cae2ee55543f9b67352425f5753126de2fa9e5c 100644 (file)
@@ -92,7 +92,7 @@ const char *stat_status_codes[STAT_STATUS_SIZE] = {
  * to always use the exact same name except that the strings for new names must
  * be lower case or CamelCase while the enum entries must be upper case.
  */
-const struct name_desc stat_cols_info[ST_I_INF_MAX] = {
+const struct stat_col stat_cols_info[ST_I_INF_MAX] = {
        [ST_I_INF_NAME]                           = { .name = "Name",                        .desc = "Product name" },
        [ST_I_INF_VERSION]                        = { .name = "Version",                     .desc = "Product version" },
        [ST_I_INF_RELEASE_DATE]                   = { .name = "Release_date",                .desc = "Date of latest source code update" },