mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 06:40:59 +01:00
MINOR: stats: inc req counter on listeners.
This patch enables count of requests for listeners if listener's counters are enabled.
This commit is contained in:
parent
c47ba59d1e
commit
2897644ae5
@ -140,9 +140,11 @@ static inline void proxy_inc_be_ctr(struct proxy *be)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* increase the number of cumulated requests on the designated frontend */
|
/* increase the number of cumulated requests on the designated frontend */
|
||||||
static inline void proxy_inc_fe_req_ctr(struct proxy *fe)
|
static inline void proxy_inc_fe_req_ctr(struct listener *l, struct proxy *fe)
|
||||||
{
|
{
|
||||||
_HA_ATOMIC_ADD(&fe->fe_counters.p.http.cum_req, 1);
|
_HA_ATOMIC_ADD(&fe->fe_counters.p.http.cum_req, 1);
|
||||||
|
if (l->counters)
|
||||||
|
_HA_ATOMIC_ADD(&l->counters->p.http.cum_req, 1);
|
||||||
HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.p.http.rps_max,
|
HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.p.http.rps_max,
|
||||||
update_freq_ctr(&fe->fe_req_per_sec, 1));
|
update_freq_ctr(&fe->fe_req_per_sec, 1));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,7 +98,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit)
|
|||||||
if (htx->flags & (HTX_FL_PARSING_ERROR|HTX_FL_PROCESSING_ERROR)) {
|
if (htx->flags & (HTX_FL_PARSING_ERROR|HTX_FL_PROCESSING_ERROR)) {
|
||||||
stream_inc_http_req_ctr(s);
|
stream_inc_http_req_ctr(s);
|
||||||
stream_inc_http_err_ctr(s);
|
stream_inc_http_err_ctr(s);
|
||||||
proxy_inc_fe_req_ctr(sess->fe);
|
proxy_inc_fe_req_ctr(sess->listener, sess->fe);
|
||||||
if (htx->flags & HTX_FL_PARSING_ERROR)
|
if (htx->flags & HTX_FL_PARSING_ERROR)
|
||||||
goto return_bad_req;
|
goto return_bad_req;
|
||||||
else
|
else
|
||||||
@ -149,7 +149,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit)
|
|||||||
|
|
||||||
stream_inc_http_err_ctr(s);
|
stream_inc_http_err_ctr(s);
|
||||||
stream_inc_http_req_ctr(s);
|
stream_inc_http_req_ctr(s);
|
||||||
proxy_inc_fe_req_ctr(sess->fe);
|
proxy_inc_fe_req_ctr(sess->listener, sess->fe);
|
||||||
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
|
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
|
||||||
if (sess->listener->counters)
|
if (sess->listener->counters)
|
||||||
_HA_ATOMIC_ADD(&sess->listener->counters->failed_req, 1);
|
_HA_ATOMIC_ADD(&sess->listener->counters->failed_req, 1);
|
||||||
@ -176,7 +176,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit)
|
|||||||
|
|
||||||
stream_inc_http_err_ctr(s);
|
stream_inc_http_err_ctr(s);
|
||||||
stream_inc_http_req_ctr(s);
|
stream_inc_http_req_ctr(s);
|
||||||
proxy_inc_fe_req_ctr(sess->fe);
|
proxy_inc_fe_req_ctr(sess->listener, sess->fe);
|
||||||
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
|
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
|
||||||
if (sess->listener->counters)
|
if (sess->listener->counters)
|
||||||
_HA_ATOMIC_ADD(&sess->listener->counters->failed_req, 1);
|
_HA_ATOMIC_ADD(&sess->listener->counters->failed_req, 1);
|
||||||
@ -203,7 +203,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit)
|
|||||||
|
|
||||||
stream_inc_http_err_ctr(s);
|
stream_inc_http_err_ctr(s);
|
||||||
stream_inc_http_req_ctr(s);
|
stream_inc_http_req_ctr(s);
|
||||||
proxy_inc_fe_req_ctr(sess->fe);
|
proxy_inc_fe_req_ctr(sess->listener, sess->fe);
|
||||||
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
|
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
|
||||||
if (sess->listener->counters)
|
if (sess->listener->counters)
|
||||||
_HA_ATOMIC_ADD(&sess->listener->counters->failed_req, 1);
|
_HA_ATOMIC_ADD(&sess->listener->counters->failed_req, 1);
|
||||||
@ -271,7 +271,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit)
|
|||||||
|
|
||||||
msg->msg_state = HTTP_MSG_BODY;
|
msg->msg_state = HTTP_MSG_BODY;
|
||||||
stream_inc_http_req_ctr(s);
|
stream_inc_http_req_ctr(s);
|
||||||
proxy_inc_fe_req_ctr(sess->fe); /* one more valid request for this FE */
|
proxy_inc_fe_req_ctr(sess->listener, sess->fe); /* one more valid request for this FE */
|
||||||
|
|
||||||
/* kill the pending keep-alive timeout */
|
/* kill the pending keep-alive timeout */
|
||||||
txn->flags &= ~TX_WAIT_NEXT_RQ;
|
txn->flags &= ~TX_WAIT_NEXT_RQ;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user