From: Amaury Denoyelle Date: Fri, 2 Oct 2020 16:32:00 +0000 (+0200) Subject: REORG: stats: export some functions X-Git-Tag: v2.3-dev6~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ca927e68f901d0246c55504013aa190b7aebdd2;p=thirdparty%2Fhaproxy.git REORG: stats: export some functions Un-mark stats_dump_one_line and stats_putchk as static and export them in the header file. These functions will be reusable by other components to print their statistics. This patch is needed to extend stat support to components other than proxies objects. --- diff --git a/include/haproxy/stats.h b/include/haproxy/stats.h index 4e1b5353c2..3c53486d08 100644 --- a/include/haproxy/stats.h +++ b/include/haproxy/stats.h @@ -39,6 +39,11 @@ extern const char *stat_status_codes[]; extern struct applet http_stats_applet; +struct htx; +int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk); + +int stats_dump_one_line(const struct field *stats, struct proxy *px, struct appctx *appctx); + int stats_fill_info(struct field *info, int len); int stats_fill_fe_stats(struct proxy *px, struct field *stats, int len); int stats_fill_li_stats(struct proxy *px, struct listener *l, int flags, diff --git a/src/stats.c b/src/stats.c index c306bfcef3..9b2e9117bf 100644 --- a/src/stats.c +++ b/src/stats.c @@ -259,7 +259,7 @@ static THREAD_LOCAL struct field stats[ST_F_TOTAL_FIELDS]; static void stats_dump_json_schema(struct buffer *out); -static int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk) +int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk) { if (htx) { if (chk->data >= channel_htx_recv_max(chn, htx)) @@ -1381,7 +1381,7 @@ static int stats_dump_fields_html(struct buffer *out, return 1; } -static int stats_dump_one_line(const struct field *stats, struct proxy *px, struct appctx *appctx) +int stats_dump_one_line(const struct field *stats, struct proxy *px, struct appctx *appctx) { int ret;