mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-07 07:42:49 -04:00
MINOR: compression: make the stats a bit more robust
To ensure that we only count when a response was compressed, we also check for the SN_COMP_READY flag which indicates that the compression was effectively initialized. Comp_algo alone is meaningless.
This commit is contained in:
parent
9101535038
commit
8139b9959f
2 changed files with 4 additions and 4 deletions
|
|
@ -4040,14 +4040,14 @@ void http_end_txn_clean_session(struct session *s)
|
|||
|
||||
if (s->fe->mode == PR_MODE_HTTP) {
|
||||
s->fe->fe_counters.p.http.rsp[n]++;
|
||||
if (s->comp_algo)
|
||||
if (s->comp_algo && (s->flags & SN_COMP_READY))
|
||||
s->fe->fe_counters.p.http.comp_rsp++;
|
||||
}
|
||||
if ((s->flags & SN_BE_ASSIGNED) &&
|
||||
(s->be->mode == PR_MODE_HTTP)) {
|
||||
s->be->be_counters.p.http.rsp[n]++;
|
||||
s->be->be_counters.p.http.cum_req++;
|
||||
if (s->comp_algo)
|
||||
if (s->comp_algo && (s->flags & SN_COMP_READY))
|
||||
s->be->be_counters.p.http.comp_rsp++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2435,14 +2435,14 @@ struct task *process_session(struct task *t)
|
|||
|
||||
if (s->fe->mode == PR_MODE_HTTP) {
|
||||
s->fe->fe_counters.p.http.rsp[n]++;
|
||||
if (s->comp_algo)
|
||||
if (s->comp_algo && (s->flags & SN_COMP_READY))
|
||||
s->fe->fe_counters.p.http.comp_rsp++;
|
||||
}
|
||||
if ((s->flags & SN_BE_ASSIGNED) &&
|
||||
(s->be->mode == PR_MODE_HTTP)) {
|
||||
s->be->be_counters.p.http.rsp[n]++;
|
||||
s->be->be_counters.p.http.cum_req++;
|
||||
if (s->comp_algo)
|
||||
if (s->comp_algo && (s->flags & SN_COMP_READY))
|
||||
s->be->be_counters.p.http.comp_rsp++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue