mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 14:50:59 +01:00
MINOR: session: add the necessary functions to update the per-session glitches
This provides a new function session_add_glitch_ctr() that will update the glitch counter and rate for the session, if tracked at all.
This commit is contained in:
parent
c9c6b683fb
commit
8581d62daf
@ -39,6 +39,8 @@ void session_free(struct session *sess);
|
|||||||
int session_accept_fd(struct connection *cli_conn);
|
int session_accept_fd(struct connection *cli_conn);
|
||||||
int conn_complete_session(struct connection *conn);
|
int conn_complete_session(struct connection *conn);
|
||||||
struct task *session_expire_embryonic(struct task *t, void *context, unsigned int state);
|
struct task *session_expire_embryonic(struct task *t, void *context, unsigned int state);
|
||||||
|
void __session_add_glitch_ctr(struct session *sess, uint inc);
|
||||||
|
|
||||||
|
|
||||||
/* Remove the refcount from the session to the tracked counters, and clear the
|
/* Remove the refcount from the session to the tracked counters, and clear the
|
||||||
* pointer to ensure this is only performed once. The caller is responsible for
|
* pointer to ensure this is only performed once. The caller is responsible for
|
||||||
@ -123,6 +125,14 @@ static inline void session_inc_http_fail_ctr(struct session *sess)
|
|||||||
stkctr_inc_http_fail_ctr(&sess->stkctr[i]);
|
stkctr_inc_http_fail_ctr(&sess->stkctr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add <inc> to the number of cumulated glitches in the tracked counters, and
|
||||||
|
* implicitly update the rate if also tracked.
|
||||||
|
*/
|
||||||
|
static inline void session_add_glitch_ctr(struct session *sess, uint inc)
|
||||||
|
{
|
||||||
|
if (sess->stkctr && inc)
|
||||||
|
__session_add_glitch_ctr(sess, inc);
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove the connection from the session list, and destroy the srv_list if it's now empty */
|
/* Remove the connection from the session list, and destroy the srv_list if it's now empty */
|
||||||
static inline void session_unown_conn(struct session *sess, struct connection *conn)
|
static inline void session_unown_conn(struct session *sess, struct connection *conn)
|
||||||
|
|||||||
@ -520,6 +520,18 @@ int conn_complete_session(struct connection *conn)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add <inc> to the number of cumulated glitches in the tracked counters for
|
||||||
|
* session <sess> which is known for being tracked, and implicitly update the
|
||||||
|
* rate if also tracked.
|
||||||
|
*/
|
||||||
|
void __session_add_glitch_ctr(struct session *sess, uint inc)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < global.tune.nb_stk_ctr; i++)
|
||||||
|
stkctr_add_glitch_ctr(&sess->stkctr[i], inc);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
* c-indent-level: 8
|
* c-indent-level: 8
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user