unsigned int cps_max; /* maximum of new connections received per second */
unsigned int sps_max; /* maximum of new connections accepted per second (sessions) */
+ struct freq_ctr _sess_per_sec; /* sessions per second on this frontend, used to compute sps_max (internal use only) */
+ struct freq_ctr _conn_per_sec; /* connections per second on this frontend, used to compute cps_max (internal use only) */
union {
struct {
unsigned int rps_max; /* maximum of new HTTP requests second observed */
+ struct freq_ctr _req_per_sec; /* HTTP requests per second on the frontend, only used to compute rps_max */
} http;
} p; /* protocol-specific stats */
};
unsigned int nbpend_max; /* max number of pending connections with no server assigned yet */
unsigned int cur_sess_max; /* max number of currently active sessions */
+ struct freq_ctr _sess_per_sec; /* sessions per second on this frontend, used to compute sps_max (internal use only) */
+
unsigned int q_time, c_time, d_time, t_time; /* sums of conn_time, queue_time, data_time, total_time */
unsigned int qtime_max, ctime_max, dtime_max, ttime_max; /* maximum of conn_time, queue_time, data_time, total_time observed */
_HA_ATOMIC_INC(&fe->fe_counters.shared->cum_conn);
if (l && l->counters)
_HA_ATOMIC_INC(&l->counters->shared->cum_conn);
+ update_freq_ctr(&fe->fe_counters.shared->conn_per_sec, 1);
HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.cps_max,
- update_freq_ctr(&fe->fe_counters.shared->conn_per_sec, 1));
+ update_freq_ctr(&fe->fe_counters._conn_per_sec, 1));
}
/* increase the number of cumulated connections accepted by the designated frontend */
_HA_ATOMIC_INC(&fe->fe_counters.shared->cum_sess);
if (l && l->counters)
_HA_ATOMIC_INC(&l->counters->shared->cum_sess);
+ update_freq_ctr(&fe->fe_counters.shared->sess_per_sec, 1);
HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.sps_max,
- update_freq_ctr(&fe->fe_counters.shared->sess_per_sec, 1));
+ update_freq_ctr(&fe->fe_counters._sess_per_sec, 1));
}
/* increase the number of cumulated HTTP sessions on the designated frontend.
static inline void proxy_inc_be_ctr(struct proxy *be)
{
_HA_ATOMIC_INC(&be->be_counters.shared->cum_sess);
+ update_freq_ctr(&be->be_counters.shared->sess_per_sec, 1);
HA_ATOMIC_UPDATE_MAX(&be->be_counters.sps_max,
- update_freq_ctr(&be->be_counters.shared->sess_per_sec, 1));
+ update_freq_ctr(&be->be_counters._sess_per_sec, 1));
}
/* increase the number of cumulated requests on the designated frontend.
_HA_ATOMIC_INC(&fe->fe_counters.shared->p.http.cum_req[http_ver]);
if (l && l->counters)
_HA_ATOMIC_INC(&l->counters->shared->p.http.cum_req[http_ver]);
+ update_freq_ctr(&fe->fe_counters.shared->req_per_sec, 1);
HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.p.http.rps_max,
- update_freq_ctr(&fe->fe_counters.shared->req_per_sec, 1));
+ update_freq_ctr(&fe->fe_counters.p.http._req_per_sec, 1));
}
/* Returns non-zero if the proxy is configured to retry a request if we got that status, 0 otherwise */
static inline void srv_inc_sess_ctr(struct server *s)
{
_HA_ATOMIC_INC(&s->counters.shared->cum_sess);
+ update_freq_ctr(&s->counters.shared->sess_per_sec, 1);
HA_ATOMIC_UPDATE_MAX(&s->counters.sps_max,
- update_freq_ctr(&s->counters.shared->sess_per_sec, 1));
+ update_freq_ctr(&s->counters._sess_per_sec, 1));
}
/* set the time of last session on the designated server */