From: Aurelien DARRAGON Date: Mon, 17 Mar 2025 10:37:10 +0000 (+0100) Subject: MINOR: stats: use stat_col storage stat_cols_info X-Git-Tag: v3.2-dev8~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af68343a56821d15963e7bdc1dade68e34a2e7c4;p=thirdparty%2Fhaproxy.git MINOR: stats: use stat_col storage stat_cols_info 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. --- diff --git a/include/haproxy/stats.h b/include/haproxy/stats.h index af9965281..f292ba4dd 100644 --- a/include/haproxy/stats.h +++ b/include/haproxy/stats.h @@ -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[]; diff --git a/src/stats.c b/src/stats.c index 1e5461b5b..6cae2ee55 100644 --- a/src/stats.c +++ b/src/stats.c @@ -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" },