size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
int ret = 1;
- if (!stats_fill_info(info, INF_TOTAL_FIELDS))
+ if (!stats_fill_info(info, INF_TOTAL_FIELDS, 0))
return -1;
for (; appctx->st2 < INF_TOTAL_FIELDS; appctx->st2++) {
int stats_dump_one_line(const struct field *stats, size_t stats_count, struct appctx *appctx);
-int stats_fill_info(struct field *info, int len);
+int stats_fill_info(struct field *info, int len, uint flags);
int stats_fill_fe_stats(struct proxy *px, struct field *stats, int len,
enum stat_field *selected_field);
int stats_fill_li_stats(struct proxy *px, struct listener *l, int flags,
{
int i;
- stats_fill_info(stats, STATS_LEN);
+ stats_fill_info(stats, STATS_LEN, 0);
lua_newtable(L);
for (i=0; i<INF_TOTAL_FIELDS; i++) {
return 1;
}
-/* Fill <info> with HAProxy global info. <info> is preallocated
- * array of length <len>. The length of the array must be
- * INF_TOTAL_FIELDS. If this length is less then this value, the
- * function returns 0, otherwise, it returns 1.
+/* Fill <info> with HAProxy global info. <info> is preallocated array of length
+ * <len>. The length of the array must be INF_TOTAL_FIELDS. If this length is
+ * less then this value, the function returns 0, otherwise, it returns 1. Some
+ * fields' presence or precision may depend on some of the STAT_* flags present
+ * in <flags>.
*/
-int stats_fill_info(struct field *info, int len)
+int stats_fill_info(struct field *info, int len, uint flags)
{
unsigned int up = (now.tv_sec - start_date.tv_sec);
struct buffer *out = get_trash_chunk();
{
struct appctx *appctx = __objt_appctx(si->end);
- if (!stats_fill_info(info, INF_TOTAL_FIELDS))
+ if (!stats_fill_info(info, INF_TOTAL_FIELDS, appctx->ctx.stats.flags))
return 0;
chunk_reset(&trash);