[STATS] report HTTP requests (total and rate) in frontends
Now that we support keep-alive, it's important to report a separate
counter for requests. Right now it just appears in the CSV output.
diff --git a/include/proto/proxy.h b/include/proto/proxy.h
index 5297d08..288ca22 100644
--- a/include/proto/proxy.h
+++ b/include/proto/proxy.h
@@ -89,6 +89,15 @@
be->counters.be_sps_max = be->be_sess_per_sec.curr_ctr;
}
+/* increase the number of cumulated requests on the designated frontend */
+static void inline proxy_inc_fe_req_ctr(struct proxy *fe)
+{
+ fe->counters.cum_fe_req++;
+ update_freq_ctr(&fe->fe_req_per_sec, 1);
+ if (fe->fe_req_per_sec.curr_ctr > fe->counters.fe_rps_max)
+ fe->counters.fe_rps_max = fe->fe_req_per_sec.curr_ctr;
+}
+
#endif /* _PROTO_PROXY_H */
/*
diff --git a/include/types/counters.h b/include/types/counters.h
index fa648a3..2b48207 100644
--- a/include/types/counters.h
+++ b/include/types/counters.h
@@ -25,9 +25,11 @@
struct pxcounters {
unsigned int feconn_max, beconn_max; /* max # of active frontend and backend sessions */
+ long long cum_fe_req; /* cumulated number of processed HTTP requests */
long long cum_feconn, cum_beconn; /* cumulated number of processed sessions */
long long cum_lbconn; /* cumulated number of sessions processed by load balancing */
+ unsigned int fe_rps_max; /* maximum of new sessions per second seen on the frontend */
unsigned int fe_sps_max; /* maximum of new sessions per second seen on the frontend */
unsigned int be_sps_max; /* maximum of new sessions per second seen on the backend */
unsigned int nbpend_max; /* max number of pending connections with no server assigned yet */
diff --git a/include/types/proxy.h b/include/types/proxy.h
index fabc936..53c00f7 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -225,6 +225,7 @@
int nbpend; /* number of pending connections with no server assigned yet */
int totpend; /* total number of pending connections on this instance (for stats) */
unsigned int feconn, beconn; /* # of active frontend and backends sessions */
+ struct freq_ctr fe_req_per_sec; /* HTTP requests per second on the frontend */
struct freq_ctr fe_sess_per_sec; /* sessions per second on the frontend */
struct freq_ctr be_sess_per_sec; /* sessions per second on the backend */
unsigned int maxconn; /* max # of active sessions on the frontend */