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.
This commit is contained in:
Aurelien DARRAGON 2025-03-17 11:37:10 +01:00
parent 8aa8626d12
commit af68343a56
2 changed files with 2 additions and 2 deletions

View 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[];

View 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" },