[MEDIUM] stats: count server retries and redispatches
It is important to know how your installation performs. Haproxy masks
connection errors, which is extremely good for a client but it is bad for
an administrator (except people believing that "ignorance is a bless").
Attached patch adds retries and redispatches counters, so now haproxy:
1. For server:
- counts retried connections (masked or not)
2. For backends:
- counts retried connections (masked or not) that happened to
a slave server
- counts redispatched connections
- does not count successfully redispatched connections as backend errors.
Errors are increased only when client does not get a valid response,
in other words: with failed redispatch or when this function is not
enabled.
3. For statistics:
- display Retr (retries) and Redis (redispatches) as a "Warning"
information.
diff --git a/src/proto_http.c b/src/proto_http.c
index 7077df5..f9b51d8 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -2493,7 +2493,7 @@
if (t->srv)
t->srv->failed_conns++;
- t->be->failed_conns++;
+ t->be->redispatches++;
t->flags &= ~(SN_DIRECT | SN_ASSIGNED | SN_ADDR_SET);
t->srv = NULL; /* it's left to the dispatcher to choose a server */