CLEANUP: promex: remove unused PROMEX_FL_{INFO,FRONT,BACK,LI,SRV} flags

Now promex metric dumping relies on stat_cols API, we don't make use of
these flags, so let's remove them.
This commit is contained in:
Aurelien DARRAGON 2025-03-20 11:24:23 +01:00
parent 2ab82124ec
commit 85f2f93d11
2 changed files with 10 additions and 15 deletions

View File

@ -32,11 +32,11 @@
/* Prometheus exporter flags (ctx->flags) */ /* Prometheus exporter flags (ctx->flags) */
#define PROMEX_FL_METRIC_HDR 0x00000001 #define PROMEX_FL_METRIC_HDR 0x00000001
#define PROMEX_FL_INFO_METRIC 0x00000002 /* unused: 0x00000002 */
#define PROMEX_FL_FRONT_METRIC 0x00000004 /* unused: 0x00000004 */
#define PROMEX_FL_BACK_METRIC 0x00000008 /* unused: 0x00000008 */
#define PROMEX_FL_SRV_METRIC 0x00000010 /* unused: 0x00000010 */
#define PROMEX_FL_LI_METRIC 0x00000020 /* unused: 0x00000020 */
#define PROMEX_FL_MODULE_METRIC 0x00000040 #define PROMEX_FL_MODULE_METRIC 0x00000040
#define PROMEX_FL_SCOPE_GLOBAL 0x00000080 #define PROMEX_FL_SCOPE_GLOBAL 0x00000080
#define PROMEX_FL_SCOPE_FRONT 0x00000100 #define PROMEX_FL_SCOPE_FRONT 0x00000100

View File

@ -1805,7 +1805,7 @@ static int promex_dump_metrics(struct appctx *appctx, struct stconn *sc, struct
switch (appctx->st1) { switch (appctx->st1) {
case PROMEX_DUMPER_INIT: case PROMEX_DUMPER_INIT:
ctx->flags |= (PROMEX_FL_METRIC_HDR|PROMEX_FL_INFO_METRIC); ctx->flags |= PROMEX_FL_METRIC_HDR;
ctx->obj_state = 0; ctx->obj_state = 0;
ctx->field_num = ST_I_INF_NAME; ctx->field_num = ST_I_INF_NAME;
appctx->st1 = PROMEX_DUMPER_GLOBAL; appctx->st1 = PROMEX_DUMPER_GLOBAL;
@ -1821,8 +1821,7 @@ static int promex_dump_metrics(struct appctx *appctx, struct stconn *sc, struct
} }
} }
ctx->flags &= ~PROMEX_FL_INFO_METRIC; ctx->flags |= PROMEX_FL_METRIC_HDR;
ctx->flags |= (PROMEX_FL_METRIC_HDR|PROMEX_FL_FRONT_METRIC);
ctx->obj_state = 0; ctx->obj_state = 0;
ctx->field_num = ST_I_PX_PXNAME; ctx->field_num = ST_I_PX_PXNAME;
ctx->mod_field_num = 0; ctx->mod_field_num = 0;
@ -1839,8 +1838,7 @@ static int promex_dump_metrics(struct appctx *appctx, struct stconn *sc, struct
} }
} }
ctx->flags &= ~PROMEX_FL_FRONT_METRIC; ctx->flags |= PROMEX_FL_METRIC_HDR;
ctx->flags |= (PROMEX_FL_METRIC_HDR|PROMEX_FL_LI_METRIC);
ctx->obj_state = 0; ctx->obj_state = 0;
ctx->field_num = ST_I_PX_PXNAME; ctx->field_num = ST_I_PX_PXNAME;
ctx->mod_field_num = 0; ctx->mod_field_num = 0;
@ -1857,8 +1855,7 @@ static int promex_dump_metrics(struct appctx *appctx, struct stconn *sc, struct
} }
} }
ctx->flags &= ~PROMEX_FL_LI_METRIC; ctx->flags |= PROMEX_FL_METRIC_HDR;
ctx->flags |= (PROMEX_FL_METRIC_HDR|PROMEX_FL_BACK_METRIC);
ctx->obj_state = 0; ctx->obj_state = 0;
ctx->field_num = ST_I_PX_PXNAME; ctx->field_num = ST_I_PX_PXNAME;
ctx->mod_field_num = 0; ctx->mod_field_num = 0;
@ -1875,8 +1872,7 @@ static int promex_dump_metrics(struct appctx *appctx, struct stconn *sc, struct
} }
} }
ctx->flags &= ~PROMEX_FL_BACK_METRIC; ctx->flags |= PROMEX_FL_METRIC_HDR;
ctx->flags |= (PROMEX_FL_METRIC_HDR|PROMEX_FL_SRV_METRIC);
ctx->obj_state = 0; ctx->obj_state = 0;
ctx->field_num = ST_I_PX_PXNAME; ctx->field_num = ST_I_PX_PXNAME;
ctx->mod_field_num = 0; ctx->mod_field_num = 0;
@ -1893,7 +1889,6 @@ static int promex_dump_metrics(struct appctx *appctx, struct stconn *sc, struct
} }
} }
ctx->flags &= ~(PROMEX_FL_METRIC_HDR|PROMEX_FL_SRV_METRIC);
ctx->flags |= (PROMEX_FL_METRIC_HDR|PROMEX_FL_MODULE_METRIC); ctx->flags |= (PROMEX_FL_METRIC_HDR|PROMEX_FL_MODULE_METRIC);
ctx->field_num = 0; ctx->field_num = 0;
ctx->mod_field_num = 0; ctx->mod_field_num = 0;