diff --git a/contrib/halog/Makefile b/contrib/halog/Makefile index 4cf6cb5f8..9a1b79ac2 100644 --- a/contrib/halog/Makefile +++ b/contrib/halog/Makefile @@ -5,10 +5,10 @@ OPTIMIZE = -O3 OBJS = halog halog64 halog: halog.c fgets2.c - $(CC) $(OPTIMIZE) -o $@ $(INCLUDE) $(EBTREE_DIR)/ebtree.c $(EBTREE_DIR)/eb32tree.c $^ + $(CC) $(OPTIMIZE) -o $@ $(INCLUDE) $(EBTREE_DIR)/ebtree.c $(EBTREE_DIR)/eb32tree.c $(EBTREE_DIR)/ebmbtree.c $(EBTREE_DIR)/ebsttree.c $^ halog64: halog.c fgets2-64.c - $(CC) $(OPTIMIZE) -o $@ $(INCLUDE) $(EBTREE_DIR)/ebtree.c $(EBTREE_DIR)/eb32tree.c $^ + $(CC) $(OPTIMIZE) -o $@ $(INCLUDE) $(EBTREE_DIR)/ebtree.c $(EBTREE_DIR)/eb32tree.c $(EBTREE_DIR)/ebmbtree.c $(EBTREE_DIR)/ebsttree.c $^ clean: rm -vf $(OBJS) diff --git a/contrib/halog/halog.c b/contrib/halog/halog.c index 81ffa827e..b9da76155 100644 --- a/contrib/halog/halog.c +++ b/contrib/halog/halog.c @@ -1,7 +1,7 @@ /* * haproxy log time reporter * - * Copyright 2000-2009 Willy Tarreau + * Copyright 2000-2010 Willy Tarreau * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -28,8 +28,11 @@ #include #include +#include +#define SOURCE_FIELD 5 #define ACCEPT_FIELD 6 +#define SERVER_FIELD 8 #define TIME_FIELD 9 #define STATUS_FIELD 10 #define CONN_FIELD 15 @@ -49,6 +52,13 @@ struct timer { unsigned int count; }; +struct srv_st { + unsigned int st_cnt[6]; /* 0xx to 5xx */ + unsigned int nb_ct, nb_rt, nb_ok; + unsigned long long cum_ct, cum_rt; + struct ebmb_node node; + /* don't put anything else here, the server name will be there */ +}; #define FILT_COUNT_ONLY 0x01 #define FILT_INVERT 0x02 @@ -64,6 +74,7 @@ struct timer { #define FILT_INVERT_TIME_RESP 0x400 #define FILT_COUNT_STATUS 0x800 +#define FILT_COUNT_SRV_STATUS 0x1000 unsigned int filter = 0; unsigned int filter_invert = 0; @@ -75,7 +86,7 @@ void die(const char *msg) { fprintf(stderr, "%s" - "Usage: halog [-c] [-v] [-gt] [-pct] [-st] [-s ] [-e|-E] [-rt|-RT