mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
[MEDIUM] session-counters: make it possible to count connections from frontend
In case a "track-be-counters" rule is referenced in the frontend, count it so that the connection counts are correct.
This commit is contained in:
parent
68c03aba9e
commit
9e9879a263
@ -150,6 +150,19 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
|
||||
s->fe_tracked_table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
|
||||
}
|
||||
|
||||
if (s->be_tracked_counters) {
|
||||
void *ptr;
|
||||
|
||||
ptr = stktable_data_ptr(s->be_tracked_table, s->be_tracked_counters, STKTABLE_DT_SESS_CNT);
|
||||
if (ptr)
|
||||
stktable_data_cast(ptr, sess_cnt)++;
|
||||
|
||||
ptr = stktable_data_ptr(s->be_tracked_table, s->be_tracked_counters, STKTABLE_DT_SESS_RATE);
|
||||
if (ptr)
|
||||
update_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
|
||||
s->be_tracked_table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
|
||||
}
|
||||
|
||||
/* this part should be common with other protocols */
|
||||
s->si[0].fd = cfd;
|
||||
s->si[0].owner = t;
|
||||
|
Loading…
x
Reference in New Issue
Block a user