REORG: stats: define stats-proxy source module

Create a new module stats-proxy. Move stats functions related to proxies
list looping in it. This allows to reduce stats source file dividing its
size by half.
This commit is contained in:
Amaury Denoyelle 2024-05-02 15:07:10 +02:00
parent 271def959c
commit f0644d1bd7
5 changed files with 1609 additions and 1580 deletions

View File

@ -975,7 +975,8 @@ OBJS += src/mux_h2.o src/mux_fcgi.o src/mux_h1.o src/tcpcheck.o \
src/dynbuf.o src/wdt.o src/pipe.o src/init.o src/http_acl.o \
src/hpack-huff.o src/hpack-enc.o src/dict.o src/freq_ctr.o \
src/ebtree.o src/hash.o src/dgram.o src/version.o src/proto_rhttp.o \
src/guid.o src/stats-html.o src/stats-json.o src/stats-file.o
src/guid.o src/stats-html.o src/stats-json.o src/stats-file.o \
src/stats-proxy.o
ifneq ($(TRACE),)
OBJS += src/calltrace.o

View File

@ -0,0 +1,10 @@
#ifndef _HAPROXY_STATS_PROXY_H
#define _HAPROXY_STATS_PROXY_H
struct buffer;
struct htx;
struct stconn;
int stats_dump_proxies(struct stconn *sc, struct buffer *buf, struct htx *htx);
#endif /* _HAPROXY_STATS_PROXY_H */

View File

@ -46,11 +46,13 @@ extern struct list stats_module_list[];
extern THREAD_LOCAL struct field stat_line_info[];
extern THREAD_LOCAL struct field *stat_lines[];
extern struct name_desc *stat_cols[STATS_DOMAIN_COUNT];
extern size_t stat_cols_len[STATS_DOMAIN_COUNT];
int generate_stat_tree(struct eb_root *st_tree, const struct stat_col cols[]);
struct htx;
int stats_putchk(struct appctx *appctx, struct buffer *buf, struct htx *htx);
int stats_is_full(struct appctx *appctx, struct buffer *buf, struct htx *htx);
const char *stats_scope_ptr(struct appctx *appctx);

1593
src/stats-proxy.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff