2009-10-04 08:32:53 -04:00
|
|
|
/*
|
2011-03-10 17:25:56 -05:00
|
|
|
* include/types/counters.h
|
|
|
|
|
* This file contains structure declarations for statistics counters.
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2008-2009 Krzysztof Piotr Oledzki <ole@ans.pl>
|
2014-06-17 06:19:18 -04:00
|
|
|
* Copyright 2011-2014 Willy Tarreau <w@1wt.eu>
|
2011-03-10 17:25:56 -05:00
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation, version 2.1
|
|
|
|
|
* exclusively.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
*/
|
2009-10-04 08:32:53 -04:00
|
|
|
|
|
|
|
|
#ifndef _TYPES_COUNTERS_H
|
|
|
|
|
#define _TYPES_COUNTERS_H
|
|
|
|
|
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
/* counters used by listeners and frontends */
|
|
|
|
|
struct fe_counters {
|
2011-03-10 17:25:56 -05:00
|
|
|
unsigned int conn_max; /* max # of active sessions */
|
|
|
|
|
long long cum_conn; /* cumulated number of received connections */
|
|
|
|
|
long long cum_sess; /* cumulated number of accepted connections */
|
|
|
|
|
|
|
|
|
|
unsigned int cps_max; /* maximum of new connections received per second */
|
|
|
|
|
unsigned int sps_max; /* maximum of new connections accepted per second (sessions) */
|
|
|
|
|
|
|
|
|
|
long long bytes_in; /* number of bytes transferred from the client to the server */
|
|
|
|
|
long long bytes_out; /* number of bytes transferred from the server to the client */
|
|
|
|
|
|
2012-11-21 02:27:21 -05:00
|
|
|
long long comp_in; /* input bytes fed to the compressor */
|
|
|
|
|
long long comp_out; /* output bytes emitted by the compressor */
|
|
|
|
|
long long comp_byp; /* input bytes that bypassed the compressor (cpu/ram/bw limitation) */
|
|
|
|
|
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
long long denied_req; /* blocked requests because of security concerns */
|
|
|
|
|
long long denied_resp; /* blocked responses because of security concerns */
|
2011-03-10 17:25:56 -05:00
|
|
|
long long failed_req; /* failed requests (eg: invalid or timeout) */
|
2016-10-21 10:31:13 -04:00
|
|
|
long long denied_conn; /* denied connection requests (tcp-req-conn rules) */
|
|
|
|
|
long long denied_sess; /* denied session requests (tcp-req-sess rules) */
|
2011-03-10 17:25:56 -05:00
|
|
|
|
|
|
|
|
long long cli_aborts; /* aborted responses during DATA phase caused by the client */
|
|
|
|
|
long long srv_aborts; /* aborted responses during DATA phase caused by the server */
|
2011-09-10 17:29:44 -04:00
|
|
|
long long intercepted_req; /* number of monitoring or stats requests intercepted by the frontend */
|
2009-10-04 08:32:53 -04:00
|
|
|
|
2009-10-13 15:14:09 -04:00
|
|
|
union {
|
|
|
|
|
struct {
|
2011-03-10 17:25:56 -05:00
|
|
|
long long cum_req; /* cumulated number of processed HTTP requests */
|
2012-11-24 08:54:13 -05:00
|
|
|
long long comp_rsp; /* number of compressed responses */
|
2011-03-10 17:25:56 -05:00
|
|
|
unsigned int rps_max; /* maximum of new HTTP requests second observed */
|
|
|
|
|
long long rsp[6]; /* http response codes */
|
2009-10-13 15:14:09 -04:00
|
|
|
} http;
|
2011-03-10 17:25:56 -05:00
|
|
|
} p; /* protocol-specific stats */
|
2009-10-04 08:32:53 -04:00
|
|
|
};
|
|
|
|
|
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
/* counters used by listeners and frontends */
|
|
|
|
|
struct be_counters {
|
|
|
|
|
unsigned int conn_max; /* max # of active sessions */
|
|
|
|
|
long long cum_conn; /* cumulated number of received connections */
|
|
|
|
|
long long cum_sess; /* cumulated number of accepted connections */
|
|
|
|
|
long long cum_lbconn; /* cumulated number of sessions processed by load balancing (BE only) */
|
|
|
|
|
unsigned long last_sess; /* last session time */
|
2009-10-04 08:32:53 -04:00
|
|
|
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
unsigned int cps_max; /* maximum of new connections received per second */
|
|
|
|
|
unsigned int sps_max; /* maximum of new connections accepted per second (sessions) */
|
|
|
|
|
unsigned int nbpend_max; /* max number of pending connections with no server assigned yet (BE only) */
|
2009-10-04 17:12:44 -04:00
|
|
|
unsigned int cur_sess_max; /* max number of currently active sessions */
|
|
|
|
|
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
long long bytes_in; /* number of bytes transferred from the client to the server */
|
|
|
|
|
long long bytes_out; /* number of bytes transferred from the server to the client */
|
2009-10-04 08:32:53 -04:00
|
|
|
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
long long comp_in; /* input bytes fed to the compressor */
|
|
|
|
|
long long comp_out; /* output bytes emitted by the compressor */
|
|
|
|
|
long long comp_byp; /* input bytes that bypassed the compressor (cpu/ram/bw limitation) */
|
2009-10-04 08:32:53 -04:00
|
|
|
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
long long denied_req; /* blocked requests because of security concerns */
|
|
|
|
|
long long denied_resp; /* blocked responses because of security concerns */
|
|
|
|
|
|
|
|
|
|
long long failed_conns; /* failed connect() attempts (BE only) */
|
|
|
|
|
long long failed_resp; /* failed responses (BE only) */
|
|
|
|
|
long long cli_aborts; /* aborted responses during DATA phase caused by the client */
|
|
|
|
|
long long srv_aborts; /* aborted responses during DATA phase caused by the server */
|
|
|
|
|
long long retries; /* retried and redispatched connections (BE only) */
|
|
|
|
|
long long redispatches; /* retried and redispatched connections (BE only) */
|
2009-10-04 08:32:53 -04:00
|
|
|
long long failed_secu; /* blocked responses because of security concerns */
|
|
|
|
|
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
long long failed_checks, failed_hana; /* failed health checks and health analyses for servers */
|
|
|
|
|
long long down_trans; /* up->down transitions */
|
|
|
|
|
|
2014-06-17 06:19:18 -04:00
|
|
|
unsigned int q_time, c_time, d_time, t_time; /* sums of conn_time, queue_time, data_time, total_time */
|
|
|
|
|
|
2009-10-13 15:14:09 -04:00
|
|
|
union {
|
|
|
|
|
struct {
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
long long cum_req; /* cumulated number of processed HTTP requests */
|
|
|
|
|
long long comp_rsp; /* number of compressed responses */
|
|
|
|
|
unsigned int rps_max; /* maximum of new HTTP requests second observed */
|
|
|
|
|
long long rsp[6]; /* http response codes */
|
2009-10-13 15:14:09 -04:00
|
|
|
} http;
|
CLEANUP: counters: move from 3 types to 2 types
We used to have 3 types of counters with a huge overlap :
- listener counters : stats collected for each bind line
- proxy counters : union of the frontend and backend counters
- server counters : stats collected per server
It happens that quite a good part was common between listeners and
proxies due to the frontend counters being updated at the two locations,
and that similarly the server and proxy counters were overlapping and
being updated together.
This patch cleans this up to propose only two types of counters :
- fe_counters: used by frontends and listeners, related to
incoming connections activity
- be_counters: used by backends and servers, related to outgoing
connections activity
This allowed to remove some non-sensical counters from both parts. For
frontends, the following entries were removed :
cum_lbconn, last_sess, nbpend_max, failed_conns, failed_resp,
retries, redispatches, q_time, c_time, d_time, t_time
For backends, this ones was removed : intercepted_req.
While doing this it was discovered that we used to incorrectly report
intercepted_req for backends in the HTML stats, which was always zero
since it's never updated.
Also it revealed a few inconsistencies (which were not fixed as they
are harmless). For example, backends count connections (cum_conn)
instead of sessions while servers count sessions and not connections.
Over the long term, some extra cleanups may be performed by having
some counters update functions touching both the server and backend
at the same time, as well as both the frontend and listener, to
ensure that all sides have all their stats properly filled. The stats
dump will also be able to factor the dump functions by counter types.
2016-11-25 08:44:52 -05:00
|
|
|
} p; /* protocol-specific stats */
|
2009-10-04 08:32:53 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* _TYPES_COUNTERS_H */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Local variables:
|
|
|
|
|
* c-indent-level: 8
|
|
|
|
|
* c-basic-offset: 8
|
|
|
|
|
* End:
|
|
|
|
|
*/
|