]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: stats: export some functions
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 2 Oct 2020 16:32:00 +0000 (18:32 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 5 Oct 2020 07:06:10 +0000 (09:06 +0200)
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.

include/haproxy/stats.h
src/stats.c

index 4e1b5353c2df5d914c9e7c03a7388bf13e1f1388..3c53486d08e6bff7438f94028b2ac5b6e946ed34 100644 (file)
@@ -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,
index c306bfcef3c267614f90d00254e8d9d04df6809d..9b2e9117bfd51128d6a9832cbc67c3d979baec1a 100644 (file)
@@ -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;