mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-01 17:10:42 +00:00
[MAJOR] session-counters: split FE and BE track counters
Having a single tracking pointer for both frontend and backend counters does not work. Instead let's have one for each. The keyword has changed to "track-be-counters" and "track-fe-counters", and the ACL "trk_*" changed to "trkfe_*" and "trkbe_*".
This commit is contained in:
parent
88bc4ecb82
commit
f059a0f63a
@ -53,43 +53,95 @@ int parse_track_counters(char **args, int *arg,
|
||||
*/
|
||||
static inline void session_store_counters(struct session *s)
|
||||
{
|
||||
if (s->tracked_counters) {
|
||||
void *ptr = stktable_data_ptr(s->tracked_table, s->tracked_counters, STKTABLE_DT_CONN_CUR);
|
||||
void *ptr;
|
||||
|
||||
if (s->be_tracked_counters) {
|
||||
ptr = stktable_data_ptr(s->be_tracked_table, s->be_tracked_counters, STKTABLE_DT_CONN_CUR);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, conn_cur)--;
|
||||
s->be_tracked_counters->ref_cnt--;
|
||||
s->be_tracked_counters = NULL;
|
||||
}
|
||||
|
||||
if (s->fe_tracked_counters) {
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table, s->fe_tracked_counters, STKTABLE_DT_CONN_CUR);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, conn_cur)--;
|
||||
s->fe_tracked_counters->ref_cnt--;
|
||||
s->fe_tracked_counters = NULL;
|
||||
}
|
||||
s->tracked_counters->ref_cnt--;
|
||||
s->tracked_counters = NULL;
|
||||
}
|
||||
|
||||
/* Enable tracking of session counters on stksess <ts>. The caller is
|
||||
* responsible for ensuring that <t> and <ts> are valid pointers and that no
|
||||
* previous tracked_counters was assigned to the session.
|
||||
/* Remove the refcount from the session counters tracked only by the backend if
|
||||
* any, and clear the pointer to ensure this is only performed once. The caller
|
||||
* is responsible for ensuring that the pointer is valid first.
|
||||
*/
|
||||
static inline void session_track_counters(struct session *s, struct stktable *t, struct stksess *ts)
|
||||
static inline void session_stop_backend_counters(struct session *s)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
if (!s->be_tracked_counters)
|
||||
return;
|
||||
|
||||
ptr = stktable_data_ptr(s->be_tracked_table, s->be_tracked_counters, STKTABLE_DT_CONN_CUR);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, conn_cur)--;
|
||||
s->be_tracked_counters->ref_cnt--;
|
||||
s->be_tracked_counters = NULL;
|
||||
}
|
||||
|
||||
/* Increase total and concurrent connection count for stick entry <ts> of table
|
||||
* <t>. The caller is responsible for ensuring that <t> and <ts> are valid
|
||||
* pointers, and for calling this only once per connection.
|
||||
*/
|
||||
static inline void session_start_counters(struct stktable *t, struct stksess *ts)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, conn_cur)++;
|
||||
|
||||
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, conn_cnt)++;
|
||||
|
||||
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
|
||||
t->data_arg[STKTABLE_DT_CONN_RATE].u, 1);
|
||||
if (tick_isset(t->expire))
|
||||
ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire));
|
||||
}
|
||||
|
||||
/* Enable frontend tracking of session counters on stksess <ts>. The caller is
|
||||
* responsible for ensuring that <t> and <ts> are valid pointers. Some controls
|
||||
* are performed to ensure the state can still change.
|
||||
*/
|
||||
static inline void session_track_fe_counters(struct session *s, struct stktable *t, struct stksess *ts)
|
||||
{
|
||||
if (s->fe_tracked_counters)
|
||||
return;
|
||||
|
||||
ts->ref_cnt++;
|
||||
s->tracked_table = t;
|
||||
s->tracked_counters = ts;
|
||||
if (ts) {
|
||||
void *ptr;
|
||||
s->fe_tracked_table = t;
|
||||
s->fe_tracked_counters = ts;
|
||||
session_start_counters(t, ts);
|
||||
}
|
||||
|
||||
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, conn_cur)++;
|
||||
/* Enable backend tracking of session counters on stksess <ts>. The caller is
|
||||
* responsible for ensuring that <t> and <ts> are valid pointers. Some controls
|
||||
* are performed to ensure the state can still change.
|
||||
*/
|
||||
static inline void session_track_be_counters(struct session *s, struct stktable *t, struct stksess *ts)
|
||||
{
|
||||
if (s->be_tracked_counters)
|
||||
return;
|
||||
|
||||
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, conn_cnt)++;
|
||||
|
||||
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
|
||||
t->data_arg[STKTABLE_DT_CONN_RATE].u, 1);
|
||||
|
||||
if (tick_isset(t->expire))
|
||||
ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire));
|
||||
}
|
||||
ts->ref_cnt++;
|
||||
s->be_tracked_table = t;
|
||||
s->be_tracked_counters = ts;
|
||||
session_start_counters(t, ts);
|
||||
}
|
||||
|
||||
static void inline trace_term(struct session *s, unsigned int code)
|
||||
@ -101,17 +153,28 @@ static void inline trace_term(struct session *s, unsigned int code)
|
||||
/* Increase the number of cumulated HTTP requests in the tracked counters */
|
||||
static void inline session_inc_http_req_ctr(struct session *s)
|
||||
{
|
||||
if (s->tracked_counters) {
|
||||
void *ptr;
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table, s->tracked_counters, STKTABLE_DT_HTTP_REQ_CNT);
|
||||
if (s->be_tracked_counters) {
|
||||
ptr = stktable_data_ptr(s->be_tracked_table, s->be_tracked_counters, STKTABLE_DT_HTTP_REQ_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, http_req_cnt)++;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table, s->tracked_counters, STKTABLE_DT_HTTP_REQ_RATE);
|
||||
ptr = stktable_data_ptr(s->be_tracked_table, s->be_tracked_counters, STKTABLE_DT_HTTP_REQ_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
|
||||
s->tracked_table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
|
||||
s->be_tracked_table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
|
||||
}
|
||||
|
||||
if (s->fe_tracked_counters) {
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table, s->fe_tracked_counters, STKTABLE_DT_HTTP_REQ_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, http_req_cnt)++;
|
||||
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table, s->fe_tracked_counters, STKTABLE_DT_HTTP_REQ_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
|
||||
s->fe_tracked_table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,17 +186,28 @@ static void inline session_inc_http_req_ctr(struct session *s)
|
||||
*/
|
||||
static void inline session_inc_http_err_ctr(struct session *s)
|
||||
{
|
||||
if (s->tracked_counters) {
|
||||
void *ptr;
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table, s->tracked_counters, STKTABLE_DT_HTTP_ERR_CNT);
|
||||
if (s->be_tracked_counters) {
|
||||
ptr = stktable_data_ptr(s->be_tracked_table, s->be_tracked_counters, STKTABLE_DT_HTTP_ERR_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, http_err_cnt)++;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table, s->tracked_counters, STKTABLE_DT_HTTP_ERR_RATE);
|
||||
ptr = stktable_data_ptr(s->be_tracked_table, s->be_tracked_counters, STKTABLE_DT_HTTP_ERR_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
|
||||
s->tracked_table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
|
||||
s->be_tracked_table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
|
||||
}
|
||||
|
||||
if (s->fe_tracked_counters) {
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table, s->fe_tracked_counters, STKTABLE_DT_HTTP_ERR_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, http_err_cnt)++;
|
||||
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table, s->fe_tracked_counters, STKTABLE_DT_HTTP_ERR_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
|
||||
s->fe_tracked_table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,8 @@
|
||||
enum {
|
||||
TCP_ACT_ACCEPT = 1,
|
||||
TCP_ACT_REJECT = 2,
|
||||
TCP_ACT_TRK_CTR = 3,
|
||||
TCP_ACT_TRK_FE_CTR = 3,
|
||||
TCP_ACT_TRK_BE_CTR = 4,
|
||||
};
|
||||
|
||||
struct tcp_rule {
|
||||
|
@ -184,8 +184,10 @@ struct session {
|
||||
int flags;
|
||||
} store[8]; /* tracked stickiness values to store */
|
||||
int store_count;
|
||||
struct stksess *tracked_counters; /* counters currently being tracked by this session */
|
||||
struct stktable *tracked_table; /* table the counters above belong to (undefined if counters are null) */
|
||||
struct stksess *fe_tracked_counters; /* counters currently being tracked by this session (frontend) */
|
||||
struct stktable *fe_tracked_table; /* table the counters above belong to (undefined if counters are null) */
|
||||
struct stksess *be_tracked_counters; /* counters currently being tracked by this session (backend) */
|
||||
struct stktable *be_tracked_table; /* table the counters above belong to (undefined if counters are null) */
|
||||
|
||||
struct {
|
||||
int logwait; /* log fields waiting to be collected : LW_* */
|
||||
|
@ -4990,7 +4990,7 @@ int check_config_validity()
|
||||
list_for_each_entry(trule, &curproxy->tcp_req.l4_rules, list) {
|
||||
struct proxy *target;
|
||||
|
||||
if (trule->action != TCP_ACT_TRK_CTR)
|
||||
if (trule->action != TCP_ACT_TRK_FE_CTR && trule->action != TCP_ACT_TRK_BE_CTR)
|
||||
continue;
|
||||
|
||||
if (trule->act_prm.trk_ctr.table.n)
|
||||
|
@ -3704,6 +3704,7 @@ void http_end_txn_clean_session(struct session *s)
|
||||
|
||||
s->logs.t_close = tv_ms_elapsed(&s->logs.tv_accept, &now);
|
||||
session_process_counters(s);
|
||||
session_stop_backend_counters(s);
|
||||
|
||||
if (s->txn.status) {
|
||||
int n;
|
||||
|
@ -705,7 +705,7 @@ int tcp_inspect_request(struct session *s, struct buffer *req, int an_bit)
|
||||
int tcp_exec_req_rules(struct session *s)
|
||||
{
|
||||
struct tcp_rule *rule;
|
||||
struct stksess *ts = s->tracked_counters;
|
||||
struct stksess *ts;
|
||||
struct stktable *t = NULL;
|
||||
int result = 1;
|
||||
int ret;
|
||||
@ -734,8 +734,8 @@ int tcp_exec_req_rules(struct session *s)
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
else if (rule->action == TCP_ACT_TRK_CTR) {
|
||||
if (!s->tracked_counters) {
|
||||
else if (rule->action == TCP_ACT_TRK_FE_CTR) {
|
||||
if (!s->fe_tracked_counters) {
|
||||
/* only the first valid track-counters directive applies.
|
||||
* Also, note that right now we can only track SRC so we
|
||||
* don't check how to get the key, but later we may need
|
||||
@ -744,7 +744,20 @@ int tcp_exec_req_rules(struct session *s)
|
||||
t = rule->act_prm.trk_ctr.table.t;
|
||||
ts = stktable_get_entry(t, tcpv4_src_to_stktable_key(s));
|
||||
if (ts)
|
||||
session_track_counters(s, t, ts);
|
||||
session_track_fe_counters(s, t, ts);
|
||||
}
|
||||
}
|
||||
else if (rule->action == TCP_ACT_TRK_BE_CTR) {
|
||||
if (!s->be_tracked_counters) {
|
||||
/* only the first valid track-counters directive applies.
|
||||
* Also, note that right now we can only track SRC so we
|
||||
* don't check how to get the key, but later we may need
|
||||
* to consider rule->act_prm->trk_ctr.type.
|
||||
*/
|
||||
t = rule->act_prm.trk_ctr.table.t;
|
||||
ts = stktable_get_entry(t, tcpv4_src_to_stktable_key(s));
|
||||
if (ts)
|
||||
session_track_be_counters(s, t, ts);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -868,7 +881,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
|
||||
arg++;
|
||||
rule->action = TCP_ACT_REJECT;
|
||||
}
|
||||
else if (strcmp(args[1], "track-counters") == 0) {
|
||||
else if (strcmp(args[1], "track-fe-counters") == 0) {
|
||||
int ret;
|
||||
|
||||
arg++;
|
||||
@ -878,11 +891,23 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
|
||||
if (ret < 0) /* nb: warnings are not handled yet */
|
||||
goto error;
|
||||
|
||||
rule->action = TCP_ACT_TRK_CTR;
|
||||
rule->action = TCP_ACT_TRK_FE_CTR;
|
||||
}
|
||||
else if (strcmp(args[1], "track-be-counters") == 0) {
|
||||
int ret;
|
||||
|
||||
arg++;
|
||||
ret = parse_track_counters(args, &arg, section_type, curpx,
|
||||
&rule->act_prm.trk_ctr, defpx, err, errlen);
|
||||
|
||||
if (ret < 0) /* nb: warnings are not handled yet */
|
||||
goto error;
|
||||
|
||||
rule->action = TCP_ACT_TRK_BE_CTR;
|
||||
}
|
||||
else {
|
||||
retlen = snprintf(err, errlen,
|
||||
"'%s' expects 'inspect-delay', 'content', 'accept', 'reject', or 'track-counters' in %s '%s' (was '%s')",
|
||||
"'%s' expects 'inspect-delay', 'content', 'accept', 'reject', 'track-fe-counters' or 'track-be-counters' in %s '%s' (was '%s')",
|
||||
args[0], proxy_type_str(curpx), curpx->id, args[1]);
|
||||
goto error;
|
||||
}
|
||||
|
490
src/session.c
490
src/session.c
@ -64,8 +64,10 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
||||
/* minimum session initialization required for monitor mode below */
|
||||
s->flags = 0;
|
||||
s->logs.logwait = p->to_log;
|
||||
s->tracked_counters = NULL;
|
||||
s->tracked_table = NULL;
|
||||
s->fe_tracked_counters = NULL;
|
||||
s->be_tracked_counters = NULL;
|
||||
s->fe_tracked_table = NULL;
|
||||
s->be_tracked_table = NULL;
|
||||
|
||||
/* if this session comes from a known monitoring system, we want to ignore
|
||||
* it as soon as possible, which means closing it immediately for TCP, but
|
||||
@ -120,7 +122,7 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
||||
* even initializing the stream interfaces.
|
||||
*/
|
||||
if ((l->options & LI_O_TCP_RULES) && !tcp_exec_req_rules(s)) {
|
||||
if (s->tracked_counters)
|
||||
if (s->fe_tracked_counters || s->be_tracked_counters)
|
||||
session_store_counters(s);
|
||||
task_free(t);
|
||||
LIST_DEL(&s->list);
|
||||
@ -135,17 +137,17 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
||||
if (p->feconn > p->counters.feconn_max)
|
||||
p->counters.feconn_max = p->feconn;
|
||||
proxy_inc_fe_sess_ctr(l, p);
|
||||
if (s->tracked_counters) {
|
||||
if (s->fe_tracked_counters) {
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table, s->tracked_counters, STKTABLE_DT_SESS_CNT);
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table, s->fe_tracked_counters, STKTABLE_DT_SESS_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, sess_cnt)++;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table, s->tracked_counters, STKTABLE_DT_SESS_RATE);
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table, s->fe_tracked_counters, STKTABLE_DT_SESS_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
|
||||
s->tracked_table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
|
||||
s->fe_tracked_table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
|
||||
}
|
||||
|
||||
/* this part should be common with other protocols */
|
||||
@ -273,7 +275,7 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
||||
/* work is finished, we can release everything (eg: monitoring) */
|
||||
pool_free2(pool2_buffer, s->rep);
|
||||
pool_free2(pool2_buffer, s->req);
|
||||
if (s->tracked_counters)
|
||||
if (s->fe_tracked_counters || s->be_tracked_counters)
|
||||
session_store_counters(s);
|
||||
task_free(t);
|
||||
LIST_DEL(&s->list);
|
||||
@ -297,7 +299,7 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
||||
pool_free2(pool2_buffer, s->req);
|
||||
out_free_task:
|
||||
p->feconn--;
|
||||
if (s->tracked_counters)
|
||||
if (s->fe_tracked_counters || s->be_tracked_counters)
|
||||
session_store_counters(s);
|
||||
task_free(t);
|
||||
out_free_session:
|
||||
@ -361,7 +363,7 @@ void session_free(struct session *s)
|
||||
pool_free2(fe->req_cap_pool, txn->req.cap);
|
||||
}
|
||||
|
||||
if (s->tracked_counters)
|
||||
if (s->fe_tracked_counters || s->be_tracked_counters)
|
||||
session_store_counters(s);
|
||||
|
||||
list_for_each_entry_safe(bref, back, &s->back_refs, users) {
|
||||
@ -417,21 +419,38 @@ void session_process_counters(struct session *s)
|
||||
if (s->listener->counters)
|
||||
s->listener->counters->bytes_in += bytes;
|
||||
|
||||
if (s->tracked_counters) {
|
||||
if (s->be_tracked_counters) {
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table,
|
||||
s->tracked_counters,
|
||||
ptr = stktable_data_ptr(s->be_tracked_table,
|
||||
s->be_tracked_counters,
|
||||
STKTABLE_DT_BYTES_IN_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, bytes_in_cnt) += bytes;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table,
|
||||
s->tracked_counters,
|
||||
ptr = stktable_data_ptr(s->be_tracked_table,
|
||||
s->be_tracked_counters,
|
||||
STKTABLE_DT_BYTES_IN_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
|
||||
s->tracked_table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes);
|
||||
s->be_tracked_table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes);
|
||||
}
|
||||
|
||||
if (s->fe_tracked_counters) {
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table,
|
||||
s->fe_tracked_counters,
|
||||
STKTABLE_DT_BYTES_IN_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, bytes_in_cnt) += bytes;
|
||||
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table,
|
||||
s->fe_tracked_counters,
|
||||
STKTABLE_DT_BYTES_IN_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
|
||||
s->fe_tracked_table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -451,21 +470,38 @@ void session_process_counters(struct session *s)
|
||||
if (s->listener->counters)
|
||||
s->listener->counters->bytes_out += bytes;
|
||||
|
||||
if (s->tracked_counters) {
|
||||
if (s->be_tracked_counters) {
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table,
|
||||
s->tracked_counters,
|
||||
ptr = stktable_data_ptr(s->be_tracked_table,
|
||||
s->be_tracked_counters,
|
||||
STKTABLE_DT_BYTES_OUT_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, bytes_out_cnt) += bytes;
|
||||
|
||||
ptr = stktable_data_ptr(s->tracked_table,
|
||||
s->tracked_counters,
|
||||
ptr = stktable_data_ptr(s->be_tracked_table,
|
||||
s->be_tracked_counters,
|
||||
STKTABLE_DT_BYTES_OUT_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
|
||||
s->tracked_table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes);
|
||||
s->be_tracked_table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes);
|
||||
}
|
||||
|
||||
if (s->fe_tracked_counters) {
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table,
|
||||
s->fe_tracked_counters,
|
||||
STKTABLE_DT_BYTES_OUT_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, bytes_out_cnt) += bytes;
|
||||
|
||||
ptr = stktable_data_ptr(s->fe_tracked_table,
|
||||
s->fe_tracked_counters,
|
||||
STKTABLE_DT_BYTES_OUT_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
|
||||
s->fe_tracked_table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2118,15 +2154,27 @@ acl_fetch_get_gpc0(struct stktable *table, struct acl_test *test, struct stksess
|
||||
}
|
||||
|
||||
/* set test->i to the General Purpose Counter 0 value from the session's tracked
|
||||
* counters.
|
||||
* frontend counters.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_get_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_get_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
return acl_fetch_get_gpc0(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_get_gpc0(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the General Purpose Counter 0 value from the session's tracked
|
||||
* backend counters.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_get_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
return acl_fetch_get_gpc0(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the General Purpose Counter 0 value from the session's source
|
||||
@ -2169,15 +2217,27 @@ acl_fetch_inc_gpc0(struct stktable *table, struct acl_test *test, struct stksess
|
||||
}
|
||||
|
||||
/* Increment the General Purpose Counter 0 value from the session's tracked
|
||||
* counters and return it into test->i.
|
||||
* frontend counters and return it into test->i.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_inc_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_inc_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
return acl_fetch_inc_gpc0(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_inc_gpc0(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* Increment the General Purpose Counter 0 value from the session's tracked
|
||||
* backend counters and return it into test->i.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_inc_gpc0(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
return acl_fetch_inc_gpc0(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* Increment the General Purpose Counter 0 value from the session's source
|
||||
@ -2217,15 +2277,26 @@ acl_fetch_conn_cnt(struct stktable *table, struct acl_test *test, struct stksess
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of connections from the session's tracked counters */
|
||||
/* set test->i to the cumulated number of connections from the session's tracked FE counters */
|
||||
static int
|
||||
acl_fetch_trk_conn_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_conn_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_conn_cnt(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_conn_cnt(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of connections from the session's tracked BE counters */
|
||||
static int
|
||||
acl_fetch_trkbe_conn_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_conn_cnt(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of connections from the session's source
|
||||
@ -2266,17 +2337,30 @@ acl_fetch_conn_rate(struct stktable *table, struct acl_test *test, struct stkses
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the connection rate from the session's tracked counters over
|
||||
/* set test->i to the connection rate from the session's tracked FE counters over
|
||||
* the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_conn_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_conn_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_conn_rate(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_conn_rate(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the connection rate from the session's tracked BE counters over
|
||||
* the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_conn_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_conn_rate(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the connection rate from the session's source address in the
|
||||
@ -2351,15 +2435,26 @@ acl_fetch_conn_cur(struct stktable *table, struct acl_test *test, struct stksess
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the number of concurrent connections from the session's tracked counters */
|
||||
/* set test->i to the number of concurrent connections from the session's tracked FE counters */
|
||||
static int
|
||||
acl_fetch_trk_conn_cur(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_conn_cur(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_conn_cur(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_conn_cur(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the number of concurrent connections from the session's tracked BE counters */
|
||||
static int
|
||||
acl_fetch_trkbe_conn_cur(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_conn_cur(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the number of concurrent connections from the session's source
|
||||
@ -2399,15 +2494,26 @@ acl_fetch_sess_cnt(struct stktable *table, struct acl_test *test, struct stksess
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked counters */
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked FE counters */
|
||||
static int
|
||||
acl_fetch_trk_sess_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_sess_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_sess_cnt(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_sess_cnt(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked BE counters */
|
||||
static int
|
||||
acl_fetch_trkbe_sess_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_sess_cnt(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of session from the session's source
|
||||
@ -2448,17 +2554,30 @@ acl_fetch_sess_rate(struct stktable *table, struct acl_test *test, struct stkses
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's tracked counters over
|
||||
/* set test->i to the session rate from the session's tracked FE counters over
|
||||
* the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_sess_rate(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_sess_rate(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's tracked BE counters over
|
||||
* the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_sess_rate(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's source address in the
|
||||
@ -2498,15 +2617,26 @@ acl_fetch_http_req_cnt(struct stktable *table, struct acl_test *test, struct stk
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked counters */
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked FE counters */
|
||||
static int
|
||||
acl_fetch_trk_http_req_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_http_req_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_http_req_cnt(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_http_req_cnt(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked BE counters */
|
||||
static int
|
||||
acl_fetch_trkbe_http_req_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_http_req_cnt(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of session from the session's source
|
||||
@ -2547,17 +2677,30 @@ acl_fetch_http_req_rate(struct stktable *table, struct acl_test *test, struct st
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's tracked counters over
|
||||
/* set test->i to the session rate from the session's tracked FE counters over
|
||||
* the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_http_req_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_http_req_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_http_req_rate(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_http_req_rate(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's tracked BE counters over
|
||||
* the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_http_req_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_http_req_rate(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's source address in the
|
||||
@ -2597,15 +2740,26 @@ acl_fetch_http_err_cnt(struct stktable *table, struct acl_test *test, struct stk
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked counters */
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked FE counters */
|
||||
static int
|
||||
acl_fetch_trk_http_err_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_http_err_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_http_err_cnt(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_http_err_cnt(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of sessions from the session's tracked BE counters */
|
||||
static int
|
||||
acl_fetch_trkbe_http_err_cnt(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_http_err_cnt(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the cumulated number of session from the session's source
|
||||
@ -2646,17 +2800,30 @@ acl_fetch_http_err_rate(struct stktable *table, struct acl_test *test, struct st
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's tracked counters over
|
||||
/* set test->i to the session rate from the session's tracked FE counters over
|
||||
* the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_http_err_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_http_err_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_http_err_rate(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_http_err_rate(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's tracked BE counters over
|
||||
* the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_http_err_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_http_err_rate(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the session rate from the session's source address in the
|
||||
@ -2698,16 +2865,29 @@ acl_fetch_kbytes_in(struct stktable *table, struct acl_test *test, struct stkses
|
||||
}
|
||||
|
||||
/* set test->i to the number of kbytes received from clients according to the
|
||||
* session's tracked counters.
|
||||
* session's tracked FE counters.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_kbytes_in(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_kbytes_in(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_kbytes_in(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_kbytes_in(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the number of kbytes received from clients according to the
|
||||
* session's tracked BE counters.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_kbytes_in(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_kbytes_in(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the number of kbytes received from the session's source
|
||||
@ -2750,17 +2930,30 @@ acl_fetch_bytes_in_rate(struct stktable *table, struct acl_test *test, struct st
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the bytes rate from clients from the session's tracked
|
||||
/* set test->i to the bytes rate from clients from the session's tracked FE
|
||||
* counters over the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_bytes_in_rate(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_bytes_in_rate(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the bytes rate from clients from the session's tracked BE
|
||||
* counters over the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_bytes_in_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_bytes_in_rate(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the bytes rate from clients from the session's source address
|
||||
@ -2802,16 +2995,29 @@ acl_fetch_kbytes_out(struct stktable *table, struct acl_test *test, struct stkse
|
||||
}
|
||||
|
||||
/* set test->i to the number of kbytes sent to clients according to the session's
|
||||
* tracked counters.
|
||||
* tracked FE counters.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_kbytes_out(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_kbytes_out(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_kbytes_out(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_kbytes_out(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the number of kbytes sent to clients according to the session's
|
||||
* tracked BE counters.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_kbytes_out(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_kbytes_out(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the number of kbytes sent to the session's source address in
|
||||
@ -2854,17 +3060,30 @@ acl_fetch_bytes_out_rate(struct stktable *table, struct acl_test *test, struct s
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* set test->i to the bytes rate to clients from the session's tracked counters
|
||||
/* set test->i to the bytes rate to clients from the session's tracked FE counters
|
||||
* over the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trk_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
acl_fetch_trkfe_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->tracked_counters)
|
||||
if (!l4->fe_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_bytes_out_rate(l4->tracked_table, test, l4->tracked_counters);
|
||||
return acl_fetch_bytes_out_rate(l4->fe_tracked_table, test, l4->fe_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the bytes rate to clients from the session's tracked BE counters
|
||||
* over the configured period.
|
||||
*/
|
||||
static int
|
||||
acl_fetch_trkbe_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, int dir,
|
||||
struct acl_expr *expr, struct acl_test *test)
|
||||
{
|
||||
if (!l4->be_tracked_counters)
|
||||
return 0;
|
||||
|
||||
return acl_fetch_bytes_out_rate(l4->be_tracked_table, test, l4->be_tracked_counters);
|
||||
}
|
||||
|
||||
/* set test->i to the bytes rate to client from the session's source address in
|
||||
@ -2892,37 +3111,52 @@ acl_fetch_src_bytes_out_rate(struct proxy *px, struct session *l4, void *l7, int
|
||||
|
||||
/* Note: must not be declared <const> as its list will be overwritten */
|
||||
static struct acl_kw_list acl_kws = {{ },{
|
||||
{ "trk_get_gpc0", acl_parse_int, acl_fetch_trk_get_gpc0, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_get_gpc0", acl_parse_int, acl_fetch_src_get_gpc0, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_inc_gpc0", acl_parse_int, acl_fetch_trk_inc_gpc0, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_inc_gpc0", acl_parse_int, acl_fetch_src_inc_gpc0, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_conn_cnt", acl_parse_int, acl_fetch_trk_conn_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_conn_cnt", acl_parse_int, acl_fetch_src_conn_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_conn_rate", acl_parse_int, acl_fetch_trk_conn_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_conn_rate", acl_parse_int, acl_fetch_src_conn_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "src_updt_conn_cnt", acl_parse_int, acl_fetch_src_updt_conn_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_conn_cur", acl_parse_int, acl_fetch_trk_conn_cur, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_conn_cur", acl_parse_int, acl_fetch_src_conn_cur, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_sess_cnt", acl_parse_int, acl_fetch_trk_sess_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_sess_cnt", acl_parse_int, acl_fetch_src_sess_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_sess_rate", acl_parse_int, acl_fetch_trk_sess_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_sess_rate", acl_parse_int, acl_fetch_src_sess_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_http_req_cnt", acl_parse_int, acl_fetch_trk_http_req_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_http_req_cnt", acl_parse_int, acl_fetch_src_http_req_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_http_req_rate", acl_parse_int, acl_fetch_trk_http_req_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_http_req_rate", acl_parse_int, acl_fetch_src_http_req_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_http_err_cnt", acl_parse_int, acl_fetch_trk_http_err_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_http_err_cnt", acl_parse_int, acl_fetch_src_http_err_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_http_err_rate", acl_parse_int, acl_fetch_trk_http_err_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_http_err_rate", acl_parse_int, acl_fetch_src_http_err_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_kbytes_in", acl_parse_int, acl_fetch_trk_kbytes_in, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "src_kbytes_in", acl_parse_int, acl_fetch_src_kbytes_in, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_bytes_in_rate", acl_parse_int, acl_fetch_trk_bytes_in_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_bytes_in_rate", acl_parse_int, acl_fetch_src_bytes_in_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_kbytes_out", acl_parse_int, acl_fetch_trk_kbytes_out, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "src_kbytes_out", acl_parse_int, acl_fetch_src_kbytes_out, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trk_bytes_out_rate", acl_parse_int, acl_fetch_trk_bytes_out_rate,acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_bytes_out_rate", acl_parse_int, acl_fetch_src_bytes_out_rate,acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_get_gpc0", acl_parse_int, acl_fetch_trkfe_get_gpc0, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_get_gpc0", acl_parse_int, acl_fetch_trkbe_get_gpc0, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_get_gpc0", acl_parse_int, acl_fetch_src_get_gpc0, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_inc_gpc0", acl_parse_int, acl_fetch_trkfe_inc_gpc0, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_inc_gpc0", acl_parse_int, acl_fetch_trkbe_inc_gpc0, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_inc_gpc0", acl_parse_int, acl_fetch_src_inc_gpc0, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_conn_cnt", acl_parse_int, acl_fetch_trkfe_conn_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_conn_cnt", acl_parse_int, acl_fetch_trkbe_conn_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_conn_cnt", acl_parse_int, acl_fetch_src_conn_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_conn_rate", acl_parse_int, acl_fetch_trkfe_conn_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_conn_rate", acl_parse_int, acl_fetch_trkbe_conn_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_conn_rate", acl_parse_int, acl_fetch_src_conn_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "src_updt_conn_cnt", acl_parse_int, acl_fetch_src_updt_conn_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_conn_cur", acl_parse_int, acl_fetch_trkfe_conn_cur, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_conn_cur", acl_parse_int, acl_fetch_trkbe_conn_cur, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_conn_cur", acl_parse_int, acl_fetch_src_conn_cur, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_sess_cnt", acl_parse_int, acl_fetch_trkfe_sess_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_sess_cnt", acl_parse_int, acl_fetch_trkbe_sess_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_sess_cnt", acl_parse_int, acl_fetch_src_sess_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_sess_rate", acl_parse_int, acl_fetch_trkfe_sess_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_sess_rate", acl_parse_int, acl_fetch_trkbe_sess_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_sess_rate", acl_parse_int, acl_fetch_src_sess_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_http_req_cnt", acl_parse_int, acl_fetch_trkfe_http_req_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_http_req_cnt", acl_parse_int, acl_fetch_trkbe_http_req_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_http_req_cnt", acl_parse_int, acl_fetch_src_http_req_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_http_req_rate", acl_parse_int, acl_fetch_trkfe_http_req_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_http_req_rate", acl_parse_int, acl_fetch_trkbe_http_req_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_http_req_rate", acl_parse_int, acl_fetch_src_http_req_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_http_err_cnt", acl_parse_int, acl_fetch_trkfe_http_err_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_http_err_cnt", acl_parse_int, acl_fetch_trkbe_http_err_cnt, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_http_err_cnt", acl_parse_int, acl_fetch_src_http_err_cnt, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_http_err_rate", acl_parse_int, acl_fetch_trkfe_http_err_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_http_err_rate", acl_parse_int, acl_fetch_trkbe_http_err_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_http_err_rate", acl_parse_int, acl_fetch_src_http_err_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_kbytes_in", acl_parse_int, acl_fetch_trkfe_kbytes_in, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkbe_kbytes_in", acl_parse_int, acl_fetch_trkbe_kbytes_in, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "src_kbytes_in", acl_parse_int, acl_fetch_src_kbytes_in, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_bytes_in_rate", acl_parse_int, acl_fetch_trkfe_bytes_in_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_bytes_in_rate", acl_parse_int, acl_fetch_trkbe_bytes_in_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_bytes_in_rate", acl_parse_int, acl_fetch_src_bytes_in_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_kbytes_out", acl_parse_int, acl_fetch_trkfe_kbytes_out, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkbe_kbytes_out", acl_parse_int, acl_fetch_trkbe_kbytes_out, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "src_kbytes_out", acl_parse_int, acl_fetch_src_kbytes_out, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ "trkfe_bytes_out_rate", acl_parse_int, acl_fetch_trkfe_bytes_out_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "trkbe_bytes_out_rate", acl_parse_int, acl_fetch_trkbe_bytes_out_rate, acl_match_int, ACL_USE_NOTHING },
|
||||
{ "src_bytes_out_rate", acl_parse_int, acl_fetch_src_bytes_out_rate, acl_match_int, ACL_USE_TCP4_VOLATILE },
|
||||
{ NULL, NULL, NULL, NULL },
|
||||
}};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user