MEDIUM: stats: allow to select one field in `stats_fill_li_stats`
authorWilliam Dauchy <wdauchy@gmail.com>
Sun, 14 Feb 2021 22:22:54 +0000 (23:22 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 15 Feb 2021 13:13:32 +0000 (14:13 +0100)
commit655e14ef17cda6fd282a0c5578fe3d0841b00c13
tree5e78845cda8c4e03c2c8d29fe69db8334109c320
parent64a3805309dd7b4e39dc7d11da56ec873137e23f
MEDIUM: stats: allow to select one field in `stats_fill_li_stats`

prometheus approach requires to output all values for a given metric
name; meaning we iterate through all metrics, and then iterate in the
inner loop on all objects for this metric.
In order to allow more code reuse, adapt the stats API to be able to
select one field or fill them all otherwise.
From this patch it should be possible to add support for listen stats in
prometheus.

Signed-off-by: William Dauchy <wdauchy@gmail.com>
include/haproxy/stats.h
src/hlua_fcn.c
src/stats.c